#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;
}
帮我看看哪里出了问题