C语言实现心型打印

#include "stdio.h"
#include "Windows.h"
int main()
{
	float y,x;
	 for(y = 1.5f;y > -1.5f; y -= 0.1f)
	 {
	 	 for(x = -1.5f;x < 1.5f;x += 0.05f)
		 {
	 		float a = x * x + y * y - 1; 
	 		putchar(a * a * a - x * x * y * y * y < 0 ? '*':' ');
     	 }
     	 Sleep(100);
     	 putchar('\n');
	 } 
	return 0;
} 

-------------------------------------------

个性签名:独学而无友,则孤陋而寡闻。做一个灵魂有趣的人!

如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个“推荐”哦,博主在此感谢!

posted @ 2021-11-17 14:12  比尔的歌  阅读(40)  评论(0)    收藏  举报