admin 管理员组

文章数量: 1184232


2024年3月10日发(作者:text函数日期)

c语言烟花代码简单完整

#include

#include

#include

#include

#include

#define range 500.0

#define duration 200

void firework(float x,float y);

void line_function1(float x);

void circle_function1(float x);

int main()

{

float x,y,r;

initgraph(640, 480);

srand(time(NULL));

while(1)

{

}

x=rand() % (int)range;

y=rand() % (int)(range*0.5);

firework(x,y);

closegraph();

return 0;

}

void firework(float x,float y)

{

}

void line_function1(float x)

float i;

for(i=0;i

{

}

cleardevice();

setcolor(WHITE);

line_function1(x);

circle_function1(i);

Sleep(20);

{

}

void circle_function1(float x)

{

}

setlinestyle(0, 0, 10);

setcolor(rand()%15+1);

circle(x, range*0.5, 3);

float x2;

setlinestyle(0, 0, 3);

x2=x+rand()%10*10;

setcolor(rand()%15+1);

line(x, range*0.5, x2, range*0.5);

line(x, range*0.45, x2, range*0.45);

line(x, range*0.55, x2, range*0.55);


本文标签: 语言 函数 烟花 作者 代码