您的位置首页生活百科

c语言放送针渐武新烟花代码

c语言放送针渐武新烟花代码

的有关信息介绍如下:

#include"stdlib.h"

#include"graphics.h"

#include"stdio.h"

#include"math.h"

#include"conio.h"

#defin岩略亚殖够式生施静据ePI 3.1425926

main()

{

intgdriver=DETECT,gmode,errorcode;

inta[10],b[10],x,y,c,r,i,j,t;

doublerad=0.0;

/*initializegraphicsandlocalvariables*/

initgraph(&gdriver,&gmode,"");

/*readresultof错准界则算案跑逐错伯initialization*/

errorcode=宪graphresult();

if(errorcode!=grOk) /*anerroroccurred*/

{

printf("G来自raphicserror:360问答%s/n",grapherrormsg(errorcode));

printf("Pleaseanykeytohalt:");

getch();

exit(1); /*terminatewithanerrorcode*/

}

randomize();

for(;!kbhit(兴验置似王展协);)

{

x=rand()%500+100;/*随机中心坐标*/

y=rand()%300+100;

for(r=0;r<=8;r++ )  /*烟花的大小设定*/

{

for(i厚席现孔=0,rad=0.0;rad<2*PI;rad+=0.78) /转整叫保架静生们鲁衡目*设定坐标*/

{

a[i++]=x+(int)r*10*cos(rad);

b[i]=y+(int)r*10*sin(rad);

}

t=i;

for(i=1;i<t;i++)

{

c=rand()%13+1;/*各点的颜色随机*/

setcolor(c);    /*功能:将当前图形屏幕的当前笔画颜色置为color.*/

circle(a[i],b[i],1);/*a[i],b[i]为圆心1为半径画圆*/

}

delay(10000);

delay(10000);

cleardevice();

函数名:cleardevice      

功 能:清除图形屏幕  

用 法:voidfarcleardevice(void); 

}

}

getch();

closegraph();

函数名:closegraph

功 能:关闭图形系统

用 法:voidfarclosegraph(void);

}

c语言放送针渐武新烟花代码

扩展资料

C语言:表白显示(多彩小心心)

#include<stdio.h>

#include<math.h>

#includ书领海晶采析斗觉e<stdlib福写茶即出友些未.h>

#defineI座鲜岩模操良末动20

#defineR340

#include<string.h>

intmain()

{

cha整武吧准滑具ranswer[10];

printf("遇到你\n我才发现\n曾经所有的条件\n似乎都成了我等你的借口\n\n");

printf("我对你的感情已经决堤\n所以\n请允许我,从今往后映若精入你\n明媚的眼\n");

printf("我\n想和你\n耳鬓厮磨,相濡以沫!");

printf("答应我吧!\n输入yes,你可以看到我的真心\n");

scanf("%s",answer);

floaty,x,z,f;

for(y=1.料老室座秋气旧参倍5f;y>-1.5f;y-=0良环三磁.1f)

{

for(x=-1.5史钱相入附f;x<1.5f;x+=0.05f)

{

z=x*x+y*y-1;

f=z*z*z-x*x*y*y*y;

putchar(f<=0.0f?"*********"[(int)(f*-8.0f)]:'');

}

putchar('\n');

}

longtime;

for(;;)

{

system("colora");

for(time=0;time<99999999;time++);

system("colorb");

for(time=0;time<99999999;time++);

system("colorc");

for(time=0;time<99999999;time++);

system("colord");

for(time=0;time<99999999;time++);

system("colore");

for(time=0;time<99999999;time++);

system("colorf");

for(time=0;time<99999999;time++);

system("color0");

for(time=0;time<99999999;time++);

system("color1");

for(time=0;time<99999999;time++);

system("color2");

for(time=0;time<99999999;time++);

system("color3");

for(time=0;time<99999999;time++);

system("color4");

for(time=0;time<99999999;time++);

system("color5");

for(time=0;time<99999999;time++);

system("color6");

for(time=0;time<99999999;time++);

system("color7");

for(time=0;time<99999999;time++);

system("color8");

for(time=0;time<99999999;time++);

system("color9");

}

getchar();

return0;

}