用c语言编写动态爱心且有照片,用C语言编一个程序使之用打印出一个爱心的图案

1,用C语言编一个程序使之用打印出一个爱心的图案个人认为还行 , 7以上效果较好 , 不知道你要空心的还是实心的,都附上吧(百度知道好像把两个空格的位置上传后变成了一个空格,你自己要改一下 , 输出位置为一个空格的全部改成两个,其他的不用改):实心的:#include int n;void draw(int n)=4):"); scanf("%d",&n); draw(n);return 0; } 空心的:#include int n; void draw(int n)>1)) printf(" *"); else if (j==1||j==n+2*i+1) printf(" *"); else printf(" "); for (j=1;j<=-1-2*i;j++) printf(" "); for (j=1;j<=n+2*i+1;j++) if (i==1-(n>>1)) printf(" *"); else if (j==1||j==n+2*i+1) printf(" *"); else printf(" "); printf("\n"); } }int main()
2,如何用C语言循环做一个爱心要能动的#include<stdio.h>#include<string.h>int get_left_or_right_setp() static int current = 0; static int right = 1; if (1 == right) current++; } else current--; } if (10 == current) right = 0; } else if (0 == current) right = 1; } return current;}void kongge(int step_cnt) int i = 0; for (i = 0; i < step_cnt; i++) printf(" "); }}void clear_screen() //linux选这个 system("clear"); //win选这个 //system("cls");}void printf_love() int step_cnt = get_left_or_right_setp(); kongge(step_cnt); printf(" ** ** \n"); kongge(step_cnt); printf(" * * * * \n"); kongge(step_cnt); printf(" * * * \n"); kongge(step_cnt); printf(" * * \n"); kongge(step_cnt); printf(" * * \n"); kongge(step_cnt); printf(" * * \n"); kongge(step_cnt); printf(" * * \n"); kongge(step_cnt); printf(" * * \n"); kongge(step_cnt); printf(" * * \n"); kongge(step_cnt); printf(" * * \n"); kongge(step_cnt); printf(" * * \n"); kongge(step_cnt); printf(" * * \n"); kongge(step_cnt); printf(" * * \n"); kongge(step_cnt); printf(" * * \n"); kongge(step_cnt); printf(" * \n");}int main(void) while (1) clear_screen(); printf_love(); sleep(1); } return 0;}伪动态 靠清屏实现动态
3,怎样用C语言编写个爱心图象创建一个心形图案需要的最长字符串,充分利用printf函数输出字符串的丰富控制功能,按心形图案每行所需长度和位置 , 对所创建的字符串进行截断并在所需位置上输出 , 最后在屏幕上形成由字符组成的心形图案 。//#include "stdafx.h"//If the vc++6.0, with this line.#include "stdio.h"int main(void) char a[]="I love you I love you I love you I l"; printf("\n\n\n"); printf("%*.*s\n",58,21,"_*=_ _=*_"); printf("%*.*s\n",61,25,"I love yo u I love!"); printf("%*.*s\n",63,29,"I love you I l ove you I love"); printf("%*.*s\n",65,33,a);//在屏幕第65个字符处开始输出字符串a的前33个字符,其他各句意义相同 printf("%*.*s\n",66,35,a); printf("%*.*s\n",66,35,a); printf("%*.*s\n",65,33,a); printf("%*.*s\n",64,31,a); printf("%*.*s\n",63,29,a); printf("%*.*s\n",61,25,a); printf("%*.*s\n",59,21,a); printf("%*.*s\n",57,17,a); printf("%*.*s\n",55,13,a); printf("%*.*s\n",53,9,a); printf("%*.*s\n",51,5,a); printf("%*.*s\n",50,3,a); printf("%*.*s\n",49,1,a); return 0;}双层循环就可以了不过最简单的楼上的兄弟已经说了倒心:#include<stdio.h>#include<math.h>void main()int a,b,c; for(a=1;a<=6;a++)printf(" ");for(c=1;c<=2*a-1;c++)printf("\3");else printf(" ");}printf("\n"); }}双心:#include<stdio.h>#include<math.h>void main()int a,b,c; for(a=1;a<=6;a++)for(b=1;b<=6-a;b++)printf(" ");for(c=1;c<=2*a-1;c++)if(a<5&&(c==1||c==2*a-1)||(a==5&&(c==2||c==5||c==8))||a==6&&(c==4||c==5||c==7||c==8))printf("\3");else printf(" ");}printf("\n");} for(a=1;a<=6;a++)for(b=1;b<=a;b++)printf(" ");for(c=1;c<=11-2*a;c++)if(a>1&&(c==1||c==11-2*a)||a==1&&(c==2||c==5||c==8))printf("\3");else printf(" ");} printf("\n"); }}正心:#include<stdio.h>#include<math.h>void main()int a,b,c; printf("\3\3 \3\3\n"); for(a=1;a<=6;a++)for(b=1;b<=a;b++)printf(" ");for(c=1;c<=11-2*a;c++)if(a>1&&(c==1||c==11-2*a)||a==1&&(c==2||c==5||c==8))printf("\3");else printf(" ");} printf("\n"); }}# 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; }【用c语言编写动态爱心且有照片,用C语言编一个程序使之用打印出一个爱心的图案】
4 , 心形图用C语言写出#include<stdio.h>#include<conio.h>void main(void)printf("******\n");printf("******\n");printf("***\n");printf("**\n");printf("**\n");printf("**\n");printf("**\n");printf("**\n");printf("**\n");printf("**\n");printf("**\n");printf("**\n");printf("**\n");printf("**\n");printf("**\n");printf("**\n");printf("*\n");getch();}main()clrscr();for(i=1;i<4;i++)if(j<=2-i||(j>=2+i&&j<=9-i)||j>=9+i)printf(" ");else printf("*");printf("\n");}for(i=1;i<7;i++)if(j>=i-1&&j<=12-i)printf("*");else printf(" ");printf("\n");}}根据自己的喜欢改一点点数据,就可以调整这个心的大?。M愫湍闩芽炖郑夷壳暗乃街换嵋恍幸恍械氖涑鲎址?nbsp;, 最后组成一个心形图案,我几个月前给我妈做了一个小软件就是一打开出现图案的 。。。

    推荐阅读