点赞(0)
 

0.0分

2 人评分

C语言网提供由在职研发工程师或ACM蓝桥杯竞赛优秀选手录制的视频教程,并配有习题和答疑,点击了解:

一点编程也不会写的:零基础C语言学练课程

解决困扰你多年的C语言疑难杂症特性的C语言进阶课程

从零到写出一个爬虫的Python编程课程

只会语法写不出代码?手把手带你写100个编程真题的编程百练课程

信息学奥赛或C++选手的 必学C++课程

蓝桥杯ACM、信息学奥赛的必学课程:算法竞赛课入门课程

手把手讲解近五年真题的蓝桥杯辅导课程

评论列表 共有 14 条评论

Hello 3年前 回复TA
#include<bits/stdc++.h>
#include<conio.h>
#include<windows.h>
using namespace std;
double shanghai[20]={0.6,1.1,2,3.16,5.5,7,10,20,50,100,146.23,254.13,312,403,601,1023};
double bosshealth[20]={2,3,4,5.9,8,14,19,32,73,157,200,403,801,1200,3630,20123};
double wj_shanghai=1,wj_health=10,wj_max_health=10,boss,wj_money;
void chushihua();
void game();
void gongji();
void goumai();
void shangdian();
void zhujiemian();
void fangyu();
void cend();
void chushou();
void print(char[]);
int bishou=0,caidao=0,jian=0,shenjian=0;
double bishou_1=5,caidao_1=17,jian_1=58,shenjian_1=123.1;
int hat=0,douhui=0,hu
Hello 3年前 回复TA
@天尊沐笙 额,格式错了,sorry
Hello 3年前 回复TA
@天尊沐笙 你试试这个#include<bits/stdc++.h> #include<conio.h> #include<windows.h> using namespace std; double shanghai[20]={0.6,1.1,2,3.16,5.5,7,10,20,50,100,146.23,254.13,312,403,601,1023}; double bosshealth[20]={2,3,4,5.9,8,14,19,32,73,157,200,403,801,1200,3630,20123}; double wj_shanghai=1,wj_health=10,wj_max_health=10,boss,wj_money; void chushihua(); void game(); void gongji(); void goumai(); void shangdian(); void zhujiemian(); void fangyu(); void cend(); void chushou(); void print(char[]); int bishou=0,caidao=0,jian=0,shenjian=0; double bishou_1=5,caidao_1=17,jian_1=58,shenjian_1=123.1; int hat=0,douhui=0,hudun=0,hunjia=0,shendun=0; double hat_1=7,douhui_1=21,hudun_1=49,hunjia_1=89,shendun_1=210.4; void cend() {     system("cls");     print("GAME OVER");     exit(1); } void game() {     int k;     chushihua();     IO:     printf("请输入对手等级 (0~15)
");     scanf("%d",&k);     if(k>15||k<0)     {         system("cls");         goto IO;     }     boss=bosshealth[k];     system("cls");     while(wj_health>=0)     {         srand(time(NULL));         QP:         printf("1.逃跑        2.进攻
");         char s=getch();         if(s<&#039;1&#039;||s>&#039;2&#039;)         {             system("cls");             goto QP;         }         if(s==&#039;1&#039;)         {             system("cls");             zhujiemian();         }         system("cls");         double l=shanghai[k]*((rand()%2)+1)+fabs(double(rand()%100/100-2));         printf("对手对你造成了%lf点伤害
",l);         wj_health-=l;         printf("你当前剩余血量:%lf
",wj_health);         if(wj_health<=0)             cend();         double o=wj_shanghai*((rand()%2)+1)+double(rand()%10/10);         boss-=o;         printf("你对对手造成了%lf点伤害
",o);         printf("对手当前剩余血量:%lf

",boss);         if(boss<=0)         {             printf("胜利!
获得%lf金币

当前剩余血量:%lf
",shanghai[k]+3,wj_health);             wj_money+=shanghai[k]+3;             printf("
余额:%lf
",wj_money);             getch();             if(k==15)             {                 printf("恭喜玩家!游戏胜利!
");                 getch();                 exit(1);             }             system("cls");             zhujiemian();         }     } } void zhujiemian() {     PO:     printf("1.商店 2.战斗 3.回血 4.状态
");     char k=getch();     if(k>&#039;6&#039;||k<&#039;1&#039;)     {         system("cls");         goto PO;     }     if(k==&#039;1&#039;)     {         system("cls");         shangdian();         return;     }     if(k==&#039;2&#039;)     {         system("cls");         game();         return;     }     if(k==&#039;3&#039;)     {         system("cls");         if(wj_money>0)         {             wj_money=wj_money*4/5-1;             chushihua();             wj_health=wj_max_health;             printf("回血成功!
");             getch();             system("cls");             goto PO;         }         else         {             printf("余额不足!
");             getch();             system("cls");             goto PO;         }     }     if(k==&#039;4&#039;)     {         chushihua();          system("cls");         printf("生命值:%lf
",wj_health);         printf("最大生命值:%lf
",wj_max_health);         printf("攻击力:%lf
",wj_shanghai);         printf("金币:%lf
",wj_money);          getch();         system("cls");         goto PO;     }     if(k==&#039;5&#039;)     {         string a;         system("cls");         printf("输入密码!
");         cin>>a;         if(a=="songyudashuaibi"||a=="PI")         {             wj_money+=1000;             printf("外挂生效
");             Sleep(1000);             system("cls");             goto PO;         }         printf("外挂失败
");         Sleep(1000);         system("cls");         goto PO;     } } void shangdian() {     LK:     printf("1.购买 2.返回主界面
");     char k=getch();     if(k!=&#039;1&#039;&&k!=&#039;2&#039;)     {         system("cls");         goto LK;     }     if(k==&#039;1&#039;)     {         system("cls");         goumai();         goto LK;     }     if(k==&#039;2&#039;)     {         system("cls");         zhujiemian();         return;     } } void goumai() {     ML:     printf("1.攻击 2.防御 3.返回主界面
");     char k=getch();     if(k!=&#039;1&#039;&&k!=&#039;2&#039;&&k!=&#039;3&#039;)     {         system("cls");         goto ML;     }     if(k==&#039;1&#039;)     {         system("cls");         gongji();         goto ML;     }     if(k==&#039;3&#039;)     {         system("cls");         zhujiemian();         return;     }     if(k==&#039;2&#039;)     {         fangyu();     } }  void gongji() {     OP:     system("cls");     printf("0.返回上界面
");     printf("1.返回主界面
");     printf("2.匕首 5金币
");     printf("3.菜刀 17金币
");     printf("4.剑 68金币
");     printf("5.圣剑 210金币
");     printf("提醒:金币价格与伤害成正比
");     char k=getch();     if(k<&#039;0&#039;||k>&#039;5&#039;)     {         system("cls");         goto OP;     }     if(k==&#039;0&#039;)     {         system("cls");         goumai();         return;     }     if(k==&#039;1&#039;)     {         system("cls");         zhujiemian();         return;     }     if(k==&#039;2&#039;)     {         if(wj_money>=bishou_1)         {             chushihua();             system("cls");             wj_money-=bishou_1;             bishou++;             goto OP;         }         system("cls");         printf("余额不足!
");         getch();         system("cls");         goto OP;     }     if(k==&#039;3&#039;)     {         if(wj_money>=caidao_1)         {             chushihua();             system("cls");             wj_money-=caidao_1;             caidao++;             goto OP;         }         system("cls");         printf("余额不足!
");         getch();         goto OP;     }     if(k==&#039;4&#039;)     {         if(wj_money>=jian_1)         {             chushihua();             system("cls");             wj_money-=jian_1;             jian++;             goto OP;         }         system("cls");         printf("余额不足!
");         getch();         goto OP;     }     if(k==&#039;5&#039;)     {         if(wj_money>=shenjian_1)         {             chushihua();             system("cls");             wj_money-=shenjian_1;             shenjian++;             goto OP;         }         system("cls");         printf("余额不足!
");         getch();         goto OP;     } } void fangyu() {     OP:     system("cls");     printf("0.返回上界面
");     printf("1.返回主界面
");     printf("2.帽子 7金币
");     printf("3.头盔 21金币
");     printf("4.护盾 49金币
");     printf("5.盔甲 89金币
");     printf("6.圣盾 210金币
");     printf("提醒:金币价格与伤害成正比
");     char k=getch();     if(k<&#039;0&#039;||k>&#039;6&#039;)     {         system("cls");         goto OP;     }     if(k==&#039;0&#039;)     {         system("cls");         goumai();         return;     }     if(k==&#039;1&#039;)     {         system("cls");         zhujiemian();         return;     }     if(k==&#039;2&#039;)     {         if(wj_money>=hat_1)         {             chushihua();             system("cls");             wj_money-=hat_1;             hat++;             goto OP;         }         system("cls");         printf("余额不足!
");         getch();         system("cls");         goto OP;     }     if(k==&#039;3&#039;)     {         if(wj_money>=douhui_1)         {             chushihua();             system("cls");             wj_money-=douhui_1;             douhui++;             goto OP;         }         system("cls");         printf("余额不足!
");         getch();         goto OP;     }     if(k==&#039;4&#039;)     {         if(wj_money>=hudun_1)         {             chushihua();             system("cls");             wj_money-=hudun_1;             hudun++;             goto OP;         }         system("cls");         printf("余额不足!
");         getch();         goto OP;     }     if(k==&#039;5&#039;)     {             chushihua();         if(wj_money>=hunjia_1)         {             system("cls");             wj_money-=hunjia_1;             hunjia++;             goto OP;         }         system("cls");         printf("余额不足!
");         getch();         goto OP;     }     if(k==&#039;6&#039;)     {         if(wj_money>=shendun_1)         {             chushihua();             system("cls");             wj_money-=shendun_1;             shendun++;             goto OP;         }         system("cls");         printf("余额不足!
");         getch();         goto OP;     } } void chushihua() {     wj_max_health=hat*hat_1+douhui*douhui_1+hudun*hudun_1+hunjia*hunjia_1+shendun*shendun_1+10;     wj_shanghai=bishou*bishou_1+caidao*caidao_1+jian*jian_1+shenjian*shenjian_1+1; } void print(char a[]) {     int s=strlen(a);     for(int i=0;i<s;i++)     {         cout<<a[i];         Sleep(400);     }     getch();      system("cls"); } int main() {     system("title game");     print("SY出品:打怪小游戏");     zhujiemian();     return 0; }
天尊沐笙 4年前 回复TA
后面还会陆陆续续的出一些的!请大家支持啊!(还有,有哪个大神知道我的外挂怎么没有用?)
“(可能根本就没人知道吧)”小声哔哔