文件里的数据改变不了,那位大佬来回答一下。
include<iostream>#include<iomanip>
using namespace std;
int main()
{
int q,w,e,r,t,y,u,i,o,z,x,c,a,s,d;
L2: cout<<"qlx公司出品!"<<endl;
t=100;
y=10;
u=10;
z=100;
x=2;
c=5;
a=0;
cout<<"商城请按1"<<" "<<"战斗请按2"<<" "<<"回血请按3"<<" "<<"背包请按4"<<" "<<"挑战BOOS请按5"<<setw(1688)<<endl;
cin>>q;
if(q==1){
cout<<"攻击商店1"<<" "<<"防御商店2"<<endl;
cin>>w;
if(w==1){
cout<<"破碎的小刀按1"<<"攻击+5"<<"需要5个金币"<<endl;
cout<<"手里剑按2"<<"攻击+10"<<"需要15个金币"<<endl;
cout<<"普通的剑按3"<<"攻击+15"<<"需要30个金币"<<endl;
cout<<"利剑按4"<<"攻击+20"<<"需要50个金币"<<endl;
cout<<"神剑按5"<<"攻击+25"<<"需要100个金币"<<endl;
cout<<"返回大厅按3";
cin>>r;
if(r==3)
goto L2;
cout<<"您要购买什么"<<endl;
cin>>s;
if(s=1)
{
a-=5;
y+=5;
goto L2;
}
else
cout<<"金币不足"<<endl;
goto L2;
}
else if(w==2){
cout<<"木盾按1"<<"需要3个金币"<<endl;
cout<<"石盾按2"<<"需要5个金币"<<endl;
cout<<"铁盾按3"<<"需要10个金币"<<endl;
cout<<"圣甲盾按4"<<"需要25个金币"<<endl;
cout<<"量子护盾按5"<<"需要75个金币"<<endl;
cout<<"返回大厅按3" <<endl;
cin>>r;
if(r==3)
goto L2;
}
}
if(q==4) {cout<<setw(1286)<<endl;
cout<<"血量是"<<t<<endl;
cout<<"攻击是"<<y<<endl;
cout<<"防御是"<<u<<endl;
cout<<"金币是"<<a<<endl;
cin>>r;
if(r==3)
goto L2;
}
if(q==2){
cout<<"输入对手的等级,有1,2---16,你的选择是"<<endl;
cin>>o;
if(o==1)cout<<"对手〈看门小兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<z<<" "<<x<<" "<<c<<endl;
if(o==2)cout<<"对手〈小兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+5<<" "<<x+5<<" "<<z+10<<endl;
if(o==3)cout<<"对手〈保安兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+10<<" "<<x+10<<" "<<z+20<<endl;
if(o==4)cout<<"对手〈看门小兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<z<<" "<<x<<" "<<c<<endl;
if(o==5)cout<<"对手〈小兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+5<<" "<<x+5<<" "<<z+10<<endl;
if(o==6)cout<<"对手〈保安兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+10<<" "<<x+10<<" "<<z+20<<endl;
if(o==7)cout<<"对手〈小兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+5<<" "<<x+5<<" "<<z+10<<endl;
if(o==8)cout<<"对手〈保安兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+10<<" "<<x+10<<" "<<z+20<<endl;
if(o==9)cout<<"对手〈看门小兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<z<<" "<<x<<" "<<c<<endl;
if(o==10)cout<<"对手〈小兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+5<<" "<<x+5<<" "<<z+10<<endl;
if(o==11)cout<<"对手〈保安兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+10<<" "<<x+10<<" "<<z+20<<endl;
if(o==12)cout<<"对手〈看门小兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<z<<" "<<x<<" "<<c<<endl;
if(o==13)cout<<"对手〈小兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+5<<" "<<x+5<<" "<<z+10<<endl;
if(o==14)cout<<"对手〈保安兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+10<<" "<<x+10<<" "<<z+20<<endl;
if(o==15)cout<<"对手〈小兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+5<<" "<<x+5<<" "<<z+10<<endl;
if(o==16)cout<<"对手〈保安兵〉"<<"你的攻击,防御,血量:"<<y<<" "<<u<<" "<<t<<" "<<"看门小兵的攻击,防御,血量"<<c+10<<" "<<x+10<<" "<<z+20<<endl;
}
return 0;
}
第22行破碎的小刀那里怎么才能按1之后让y+5并修改第57行的y同时加5,求回复,谢谢!