用C語言編寫心形的方法:include<stdio.h>intn;voiddraw(intn){inti,j;for(i=1-(n>>1);i<=n;i++)if(i>=0){for(j=0;j<i;j++)printf("");for(j=1;j<=2*(n-i)+1;j++...
方法一:#include<stdio.h>intn;voiddraw(intn){inti,j;for(i=1-(n>>1);i<=n;i++)if(i>=0){for(j=0;j<i;j++)printf("");for(j=1;j<=2*(n-i)+1;j++)printf("...
floaty,floatz){floata=x*x+9.0f/4.0f*y*y+z*z-1;returna*a*a-x*x*z*z*z-9.0f/80.0f*y*y*z*z*z;}fl...
創(chuàng)建一個(gè)心形圖案需要的最長字符串,充分利用printf函數(shù)輸出字符串的豐富控制功能,按心形圖案每行所需長度和位置,對所創(chuàng)建的字符串進(jìn)行截?cái)嗖⒃谒栉恢蒙陷敵?,最后在屏幕上形成由字符組成的心形圖案。//#include"stdafx.h...
給你一個(gè)我早先寫的供參考——include<stdio.h>#include"string.h"intmain(void){chara[]="IloveyouIloveyouIloveyouIl";printf("\n\n\n");printf("%*.*s\n",58,21,"_*=__=...
intmain(void){floata,x,y;for(y=1.5f;y>-1.5f;y-=0.1f){for(x=-1.5f;x<1.5f;x+=0.05f){a=x*x+y*y-1;charch=a*a*a-x*x*y*y*y<=0.0f?'*':'';putchar(ch);...
voidmain(void){printf("******\n");printf("******\n");printf("*
main(){chara[]="ILOVEYOU";inti;for(i=0;i<10;i++)printf("%c",3);printf("\n");printf("%s\n",a);for(i=0;i<10;i++)printf("%c",3);getch();}效果是這樣呵b
intmain(){inti,j,k,l,m;charc[3]="好";for(i=1;i<=5;i++)printf("\n");for(i=1;i<=3;i++){for(j=1;j<=32-2*i;j+=2)printf("");for(k=1;k<=...
include"stdio.h"include"conio.h"main(){inti,j;clrscr();for(i=1;i<4;i++){for(j=0;j<16;j++)if(j<=2-i||(j>=2+i&&j<=9-i)||j>=9+i)printf("");elseprintf("