如何用c语言输出心形
@台葛2424:怎样用c语言编写心形 -
滑飘18750684102…… int a=DETECT,b; float r,R=9; float n=10*3.14/180,x,y; int i; initgraph(&a,&b,""); circle(200,300,R); for(i=0;i<36;i++) {x=200+R*cos(i*n); y=300+R*sin(i*n); r=sqrt((x0-x)^2+(y0-y)^2);/*x0,y0为R圆上的一定点*/ circle(x0,y0,r); } closegraph();
@台葛2424:用c语言打出个心型来,求求,, -
滑飘18750684102…… //数组方式,数组heart存放由'*'组成的心形, //再由printf函数显示出来. //编译与执行环境:VC++ 6.0 #include<stdio.h> #define HIG 12 //心形高度 #define WID 32 //最长宽度31个'*'与末尾'\0'组成 int main() { char heart[HIG][WID]={ " * *", " ***** ...
@台葛2424:用C语言程序如何编写成心形?或丘比特 -
滑飘18750684102…… #include "stdio.h" #include "conio.h" main() { int i,j; clrscr(); for(i=1;i<4;i++) {for(j=0;j<16;j++) <br/>if(j<=2-i||(j>=2+i&&j<=9-i)||j>=9+i) <br/>printf(" "); <br/>else printf("*"); <br/>printf("\n");} for(i=1;i<7;i++) { for(j=0;j<16;j++) if(j>=i-1&&j<=12-i...
@台葛2424:如何用C语言画一个“心形” -
滑飘18750684102…… #include <stdio.h> int main() { for (float y = 1.5f; y > -1.5f; y -= 0.1f) { for (float x = -1.5f; x < 1.5f; x += 0.05f) { float a = x * x + y * y - 1; putchar(a * a * a - x * x * y * y * y <= 0.0f ? '*' : ' '); } putchar('\n'); } }
@台葛2424:怎样用C语言编写个爱心图象 -
滑飘18750684102…… 创建一个心形图案需要的最长字符串,充分利用printf函数输出字符串的丰富控制功能,按心形图案每行所需长度和位置,对所创建的字符串进行截断并在所需位置上输出,最后在屏幕上形成由字符组成的心形图案. //#include "stdafx.h"//If the ...
@台葛2424:如何用C语言画一个心形 -
滑飘18750684102…… #include float f(float x, float y, float z) { float a = x * x + 9.0f / 4.0f * y * y + z * z - 1; return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z; } float h(float x, float z) { for (float y = 1.0f; y >= 0.0f; y -= 0.001f) if (f(x, y, z) <= 0.0f) return y; return 0.0f; } int main()...
@台葛2424:怎样用C语言编写心形? -
滑飘18750684102…… printf(" ");printf(你算算要几个空格和*符` 一行行计好比较简单`写算法的话太复杂了`...
@台葛2424:怎么用c语言打一个心形,中间在写上“我爱你”,求代码 -
滑飘18750684102…… #include<stdio.h> int i,j,k; void f1() { for(j=1; j<=3-i; j++) printf(" "); } void f2() { for(k=1; k<=2*i+4; k++) printf("%c",3); } main() { printf(" %c%c %c%c\n",3,3,3,3); for(i=1; i<=3; i++) { f1(); f2(); f1(); f1(); f2(); f1(); printf("\n"); } for(i=1; i<=...
@台葛2424:心形图用C语言写出 -
滑飘18750684102…… #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"...
@台葛2424:如何用C语言循环做一个爱心,要能动的 -
滑飘18750684102…… #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 ...
滑飘18750684102…… int a=DETECT,b; float r,R=9; float n=10*3.14/180,x,y; int i; initgraph(&a,&b,""); circle(200,300,R); for(i=0;i<36;i++) {x=200+R*cos(i*n); y=300+R*sin(i*n); r=sqrt((x0-x)^2+(y0-y)^2);/*x0,y0为R圆上的一定点*/ circle(x0,y0,r); } closegraph();
@台葛2424:用c语言打出个心型来,求求,, -
滑飘18750684102…… //数组方式,数组heart存放由'*'组成的心形, //再由printf函数显示出来. //编译与执行环境:VC++ 6.0 #include<stdio.h> #define HIG 12 //心形高度 #define WID 32 //最长宽度31个'*'与末尾'\0'组成 int main() { char heart[HIG][WID]={ " * *", " ***** ...
@台葛2424:用C语言程序如何编写成心形?或丘比特 -
滑飘18750684102…… #include "stdio.h" #include "conio.h" main() { int i,j; clrscr(); for(i=1;i<4;i++) {for(j=0;j<16;j++) <br/>if(j<=2-i||(j>=2+i&&j<=9-i)||j>=9+i) <br/>printf(" "); <br/>else printf("*"); <br/>printf("\n");} for(i=1;i<7;i++) { for(j=0;j<16;j++) if(j>=i-1&&j<=12-i...
@台葛2424:如何用C语言画一个“心形” -
滑飘18750684102…… #include <stdio.h> int main() { for (float y = 1.5f; y > -1.5f; y -= 0.1f) { for (float x = -1.5f; x < 1.5f; x += 0.05f) { float a = x * x + y * y - 1; putchar(a * a * a - x * x * y * y * y <= 0.0f ? '*' : ' '); } putchar('\n'); } }
@台葛2424:怎样用C语言编写个爱心图象 -
滑飘18750684102…… 创建一个心形图案需要的最长字符串,充分利用printf函数输出字符串的丰富控制功能,按心形图案每行所需长度和位置,对所创建的字符串进行截断并在所需位置上输出,最后在屏幕上形成由字符组成的心形图案. //#include "stdafx.h"//If the ...
@台葛2424:如何用C语言画一个心形 -
滑飘18750684102…… #include float f(float x, float y, float z) { float a = x * x + 9.0f / 4.0f * y * y + z * z - 1; return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z; } float h(float x, float z) { for (float y = 1.0f; y >= 0.0f; y -= 0.001f) if (f(x, y, z) <= 0.0f) return y; return 0.0f; } int main()...
@台葛2424:怎样用C语言编写心形? -
滑飘18750684102…… printf(" ");printf(你算算要几个空格和*符` 一行行计好比较简单`写算法的话太复杂了`...
@台葛2424:怎么用c语言打一个心形,中间在写上“我爱你”,求代码 -
滑飘18750684102…… #include<stdio.h> int i,j,k; void f1() { for(j=1; j<=3-i; j++) printf(" "); } void f2() { for(k=1; k<=2*i+4; k++) printf("%c",3); } main() { printf(" %c%c %c%c\n",3,3,3,3); for(i=1; i<=3; i++) { f1(); f2(); f1(); f1(); f2(); f1(); printf("\n"); } for(i=1; i<=...
@台葛2424:心形图用C语言写出 -
滑飘18750684102…… #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"...
@台葛2424:如何用C语言循环做一个爱心,要能动的 -
滑飘18750684102…… #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 ...