
用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語言寫愛心的程式碼是什麼?的詳細內容。更多資訊請關注PHP中文網其他相關文章!