拳师出BUG了

#include<iostream>
#include<cstdio> 
#include<cmath> 
#include<cstdlib>
#include<ctime>
#include<windows.h>
#include<cstring>
#include<algorithm>
#include<iomanip>
using namespace std;
int main(){
int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;
srand(time(0));
a=rand()%300+1;
b=rand()%75+1;
c=rand()%75+1;
d=rand()%100+1;
cout<<"您的初始生命值为"<<a<<endl; 
cout<<"您的初始攻击力为"<<b<<endl;
cout<<"您的初始防御力为"<<c<<endl;
cout<<"您的初始闪避值为"<<d<<endl<<"输入数字继续";
cin>>e;
cout<<"你是一位拳师"<<endl<<"你的师傅在三年前失踪了"<<endl<<"你的师傅留下了一封信"<<endl<<"信上说要你三年后救他"<<endl<<"三年之约已到"<<endl<<"你来救师傅";
cout<<"你在山脚遇见了个拳师,他来打劫你"<<endl<<"开始战斗";
e=rand()%100+1;
f=rand()%100+1;
g=rand()%100+1;
h=rand()%100+1;
cout<<"敌方拳师生命值"<<e<<endl;
cout<<"攻击力"<<f<<endl;
cout<<"防御力"<<g<<endl; 
cout<<"闪避值"<<h<<endl; 
while(1){
cout<<"1:攻击"<<" "<<"2:防御"<<" "<<"你要干什么?"<<endl;
cin>>i;
j=rand()%100+1;
if(i==1){
cout<<"你向他发动了攻击";
if(j==2){
cout<<"他发动了防御";
if(g>b){
cout<<"他防御失败了";
if(e>b){
e=e-b;
}else{
cout<<"你打败了他"; 
}
}else{
cout<<"他防御成功了";
}
}else{
cout<<"他发动了攻击";
k=rand()%100+1;
if(k<=d){
cout<<"你躲过了他的攻击";
l=1000;
}
if(k<=h){
cout<<"他躲过了你的攻击";
m=1000; 
}
if(l!=1000){
if(a>f){
a=a-f;
}else{
cout<<"他打败了你"; 
}
}
if(m!=1000){
if(e>b){
e=e-b;
}else{
cout<<"你打败了他"; 
}
}
}
}else{
if(j==1){
cout<<"他发动了进攻";
cout<<"你发动了防御";
if(g>b){
cout<<"你防御失败了";
if(e>b){
e=e-b;
}else{
cout<<"他打败了你"; 
}
}else{
cout<<"你防御成功了"; 

}else{
cout<<"你们都发动了防御"; 
}
}
}
cout<<"第一章,完"; 
return 0;
}

帮我看看哪里出了问题

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值