c语言文件找不到exe,这个程序怎么运行?为什么显示没有exe??

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

#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, "按任意键继续");

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, "游戏结束!" );

setfont(20, 15, "宋体");

outtextxy(50 , 220, "你的得分为:" );

outtextxy(100 + textwidth("你的得分为:"), 220, str );

getch();

}

void state()

{

setcolor(YELLOW);

setfont(20, 15, "宋体");

line(0, 480 - textheight("测")-30, 420, 480 - textheight("测")-30);

loadimage(NULL,"beijing\\beijing.jpg");

outtextxy(0 , 440, "当前分数:" );

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("当前分数:"), 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);

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值