心形图案代码
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
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 ) <= 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("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;
}
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的数字,然后就将见证奇迹!!!\n\n");
printf("\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;x1 { n=3*z; for (x2=z;x2>x1-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(" "); for (x2=z;x2<2*z+3*x1-3;x2++) printf("8"); printf("\n"); } } else { for (x1=2;x1 { n=3*z; for (x2=z;x2>x1-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(" "); for (x2=z;x2<2*z+3*x1-3;x2++) printf("8"); printf("\n"); } } for (a1=0;a1 { if (a1!=1) { printf(" "); for (b=0;b<=a1;b++) printf(" "); for (x=0;x<2*(4*z-a1)-8;x++) printf("8"); printf("\n"); } else { printf(" "); for (b=0;b<=a1;b++) printf(" "); for (b=1;b<4*z-10;b++)