爱心的编程怎么写,如何用C语言编程一个移动的爱心

1,如何用C语言编程一个移动的爱心//因为命令行不认识?,所以运行起来?会变成?,但原理相同 。#include <windows.h>void main(void){printf("?\n");Sleep(1000); // 延时一秒system("cls");//清屏printf(" ?\n");Sleep(1000);//延时一秒system("cls");//清屏printf("?\n"); Sleep(1000);//延时一秒system("cls");//清屏printf("?\n");getch();}
2,VB编写爱心用符号private sub form_click()print tab(10); "**";print tab(20); "**",print tab(6); "*";print tab(14); "*";print tab(18); "*";print tab(25); "*",print tab(4); "*";print tab(15); "*";print tab(17); "*";print tab(27); "*",print tab(3); "*";print tab(16); "*";print tab(28); "*",print tab(3); "*";print tab(28); "*",print tab(4); "*";print tab(27); "*",print tab(5); "*";print tab(26); "*",print tab(7); "*";print tab(24); "*",print tab(9); "*";print tab(22); "*",print tab(11); "*";print tab(20); "*",print tab(13); "*";print tab(17); "*",print tab(15); "*",end subhi 。。。。
3,怎么用javascript语言编程一个爱心形状呢html5确实很方便<!doctype html><html><head><meta charset="UTF-8"><title>Untitled Document</title></head><body><p style="text-align:center"><canvas id="canvas1" height="600" width="600"></canvas></p><script type="text/javascript">var canvas = document.getElementById("canvas1");var ctx = canvas.getContext("2d");ctx.translate(300,300); //sets center in the middle of the picturedrawHeart();function drawHeart() ctx.beginPath(); ctx.moveTo(0,-100); ctx.bezierCurveTo(120,-300, 300,-100, 200,50); ctx.lineTo(0,250); ctx.lineTo(-200,50); ctx.bezierCurveTo(-300,-100, -120,-300, 0,-100); ctx.closePath(); ctx.fillStyle="#ff0000"; ctx.fill();}</script></body></html>应该要先有一个爱心的源文件图片你要做出什么样子?用html5很方便【爱心的编程怎么写,如何用C语言编程一个移动的爱心】
4,怎样用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; }

    推荐阅读