一、普通的爱心图案
c语言代码是这样子的:
#include "stdafx.h"
#include <math.h>
#include <stdio.h>
int main()
{
float y, x, a;
for (y = 1.5f;y > -1.5f;y -= 0.1f)
{
for (x = -1.5f;x < 1.5f;x += 0.05f)
{
a = x*x + y*y - 1;
putchar(a*a*a - x*x*y*y*y <= 0.0f ? '*' : ' ');
}
putchar('\n');
}
return 0;
}
二、带花纹的爱心图案
C语言代码是这样子的:
#include "stdafx.h"
#include <math.h>
#include <stdio.h>
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载