《心形圖案代碼》由會員分享,可在線閱讀,更多相關(guān)《心形圖案代碼(6頁珍藏版)》請在裝配圖網(wǎng)上搜索。
1、1# 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;
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
2、) <= 0 ) )
printf("*");
else
printf(" ");
}
printf("\n");
}
getchar();
return 0;
}
2#include
#include
# include
# include
# define U 0.06
# define V 0.025
# define M 1.1
# define N 1.2
void gotoxy(int x,int y);
int main(void)
{
system("
3、mode con cols=100 lines=60");
float x, y;
float m, n;
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 ) )
printf("*");
else
printf(" ");
}
printf("\n");
}
gotoxy(0,0);
getchar();
return 0;
}
4、
void gotoxy(int x,int y)
{
COORD Pos;
Pos.X=x;
Pos.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Pos);
}
3. #include
int main(void)
{
int a1,a2,a3,b,n,x,y,z,b1;
int x1,x2,x3;
printf("\n\n\n 請先將窗口最大化!??!");
printf("\n\n\n 請輸入一個3-10的數(shù)字,然后就將見證奇跡?。?!\n\n");
printf(
5、"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf(" made by 江陳苗\n");
scanf("%d",&z);
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\n\n\n\n\n\n\n\n\n\n\n 送給最親愛的XXX:\n\n");
if (z<6)
{
printf("\n\n");
for (x1=1;x1x1-3;x2--)
printf(" ");
for (x2=z;x2<2*z+3*x1-3
6、;x2++)
printf("8");
for (x2=0;x2<4*(z-x1)-2;x2++)
printf(" ");
for (x2=z;x2<2*z+3*x1-3;x2++)
printf("8");
printf("\n");
}
}
else
{
for (x1=2;x1x1-3;x2--)
printf(" ");
for (x2=z;x2<2*z+3*x1-3;x2++)
printf("8");
for (x2=0;x2<4*(z-x1)-2;x2++)
printf(" "
7、);
for (x2=z;x2<2*z+3*x1-3;x2++)
printf("8");
printf("\n");
}
}
for (a1=0;a1
8、+)
printf("8");
printf(" I love you ");
for (b=1;b<4*z-10;b++)
printf("8");
printf("\n");
}
}
if (z<5)
{
for (a1=z,b1=0;a1<3*z;a1++,b1+=2)
{
printf(" ");
for (b=z;b<=a1;b++)
printf(" ");
for (b=0;b<=a1;b++)
printf(" ");
for (x=2;x<2*(4*z-a1)-8-b1;x++)
printf("8");
printf("\n");
9、
}
printf(" ——來自愛你的江陳苗\n\n\n");
}
else if (z<7)
{
for (a1=z,b1=0;a1<3*z-5;a1++,b1+=2)
{
printf(" ");
for (b=z;b<=a1;b++)
printf(" ");
for (b=0;b<=a1;b++)
printf(" ");
for (x=2;x<2*(4*z-a1)-8-b1;x++)
printf("8");
printf("\n");
}
printf(" ——來自愛你的江陳苗\n");
}
else
{
for (a1=z,b1=0;a1<3*z-5;a1++,b1+=2)
{
printf(" ");
for (b=z;b<=a1;b++)
printf(" ");
for (b=0;b<=a1;b++)
printf(" ");
for (x=2;x<2*(4*z-a1)-8-b1;x++)
printf("8");
printf("\n");
}
printf(" ——來自愛你的XXX\n");
}
getchar();
getchar();
return 0;
}