C语言娱乐项目————1、爱心

版权声明:严禁将博客中涉及到的技术用于恶意破坏,如果造成法律责任,博主概不负责! https://blog.csdn.net/Fly_hps/article/details/84939623

源代码

#include<stdio.h>
#include<math.h>

int main()
{
	float x,y,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');
	}
}

效果

猜你喜欢

转载自blog.csdn.net/Fly_hps/article/details/84939623
今日推荐