|
做了个无聊的程序
代码:
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
char a[50][50]={"1.开始游戏",
"2.退出游戏",
"3.作者介绍",
};
int w,g,i,e,ws,gs;
w=100;
g=50;
ws=4;
gs=7;
char ch,sh;
for(i=0;i<=2;i++)
puts(a[i]);
ch=getch();
if(ch=='2')
{
system("cls");
printf("再见,\n我会想你的。\n");
Sleep(5000);
}
if(ch=='3')
{
system("cls");
printf("by 编程CCC\n做这个程序没什么意义\n");
Sleep(10000);
}
if(ch=='1')
{
system("cls");
printf("正在加载一次性打怪游戏\n(第一关)\n本游戏现在只有第一关\n");
Sleep(20000);
system("cls");
printf("开始攻击!!!\n");
g=g/ws;
w=w/gs;
printf("谁的血多谁胜利\n");
Sleep("80000");
printf("经历好长时间终于好了\n");
printf("怪:\n%d\n我:\n%d\n",g,w);
printf("你赢了");
Sleep(20000);
}
return 0;
}
|
|