c语言运行后没生成exe,这个程序怎么运行?为什么显示没有exe??
該樓層疑似違規(guī)已被系統(tǒng)折疊?隱藏此樓查看此樓
#include
#include
#include
#include
#include
#include
void main()
{
void welcome();
void over(int x);
void state();
void score(int x);
void hp(int x);
welcome();
state();
char key;
int x, y,a,m;
int sc = 0,wc = 0;
srand(time(NULL));
while (1)
{
x = rand() % 6*70 ;
if(x/70%2==1){a=0x54FC54;}
else a=0xFC54FC;
for(y = 0;y < 360; y++)
{
setcolor(0xA80000);
setfillstyle(a);
bar(x,y,x+60,y+30);
setcolor(0xA80000);
setfillstyle(BLACK);
bar(x,y-30,x+60,y);
if (kbhit())
{
key=getch();
if(key=='s')m=0;
else if(key=='d')m=1;
else if(key=='f')m=2;
else if(key=='j')m=3;
else if(key=='k')m=4;
else if(key=='l')m=5;
else m=6;
if(m == x/70)
{
setfillstyle(BLACK);
bar(x , y , x + 60, y + 30);
sc += 10;
score(sc);
break;
}
else if(key == 27)
goto loop;
else
{
wc++;
hp(wc);
}
}
if (y == 359)
{
setfillstyle(BLACK);
bar(x , y , x + 60, y + 30);
}
if (wc == 7)
goto loop;
Sleep(1);
}
}
loop:
over(sc);
closegraph();
}
void welcome()
{
initgraph(420, 480);
setcolor(YELLOW);
setfont(60, 40, "宋體");
outtextxy(45, 35, " " );
setfont(20, 10, "宋體");
outtextxy(150, 150, "by 韓偉");
int c=255;
while (!kbhit())
{
setcolor(RGB(c, 0, 0));
setfont(40, 15, "宋體");
outtextxy(120, 200, "按任意鍵繼續(xù)");
c-=8;
Sleep(1);
}
cleardevice();
getch();
}
void over(int x)
{
char str[100];
cleardevice();
setcolor(YELLOW);
setfont(50, 50, "宋體");
itoa(x, str, 10);
outtextxy(20 , 150, "游戲結(jié)束!" );
setfont(20, 15, "宋體");
outtextxy(50 , 220, "你的得分為:" );
outtextxy(100 + textwidth("你的得分為:"), 220, str );
getch();
}
void state()
{
setcolor(YELLOW);
setfont(20, 15, "宋體");
line(0, 480 - textheight("測(cè)")-30, 420, 480 - textheight("測(cè)")-30);
loadimage(NULL,"beijing\\beijing.jpg");
outtextxy(0 , 440, "當(dāng)前分?jǐn)?shù):" );
outtextxy(230, 440, "生命值");
setfillstyle(RED);
bar(320, 430, 420, 480);
setcolor(BLUE);
rectangle(320, 430, 419, 479);
}
void score(int x)
{
char str[100];
setfont(20, 20, "宋體");
setcolor(LIGHTMAGENTA);
bar(textwidth("當(dāng)前分?jǐn)?shù):"), 440, 150, 480);
itoa(x, str, 10);
outtextxy(130,440, str);
}
void hp(int x)
{
setfillstyle(BLACK);
bar(320, 430, 420, 480);
setfillstyle(RED);
bar(320, 430, 420 - x * 15, 480);
setcolor(BLUE);
rectangle(320, 430, 420, 479);
setcolor(WHITE);
}
總結(jié)
以上是生活随笔為你收集整理的c语言运行后没生成exe,这个程序怎么运行?为什么显示没有exe??的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 安装SQL 2008的错误 等待数据库引
- 下一篇: .data()与.detach()的区别