
用c语言编写爱心的代码是什么?
用c语言编写爱心的代码是
#include <stdio.h>
#include <math.h>
#include <stdio.h>
int main()
{
float y, x, z, f;
for (y = 1.5f; y > -1.5f; y-=0.1f)
{
for (x = -1.5f; x < 1.5f; x += 0.05f)
{
z = x*x + y*y -1;
f = z*z*z - x*x*y*y*y;
putchar(f <= 0.0f ? "*********"[(int)(f*-8.0f)]:' ');
}
putchar('\n');
}
getchar();
return 0;
}
推荐教程:《C视频教程》
立即学习“C语言免费学习笔记(深入)”;
以上就是用c语言编写爱心的代码是什么?的详细内容,更多请关注php中文网其它相关文章!
C语言怎么学习?C语言怎么入门?C语言在哪学?C语言怎么学才快?不用担心,这里为大家提供了C语言速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号