<怎样用c语言编写一个爱心图形-生活百科-满米百科
> 生活百科 > 列表
怎样用c语言编写一个爱心图形
时间:2024-12-23 21:54:29
答案

# include

# include

#include

# define U 0.06

# define V 0.025

# define M 1.1

# define N 1.2

int main(void)

{

float x, y;

float m, n;

char a[6600];

for ( y=2; y>=-2; y-=U )

{

for ( x=-1.2; x<=1.2; x+=V)

{

if ( ( ( (x*x + y*y - 1)*(x*x + y*y - 1)*(x*x + y*y - 1) - x*x*y*y*y ) <= 0 ) )

strcat(a,"*");

else

strcat(a," ");

}

strcat(a,"\n");

}

strcat(a,"\0");

printf("%s\n",a);

getchar();

return 0;

}

推荐
© 2024 满米百科