#include
#include
#include
usingnamespacestd;
voidtest()
{
intall=0,win=0,answer=0;
charchoice;
intn;
inti;
do
{
vector
vector
vector
vector
n=rand()%4+2;
for(i=0;i
vs.push_back(rand()%10+1);
}
for(i=0;i
switch(rand()%4)
{
case0:
vc.push_back('+'); break;
case1:
vc.push_back('-'); break;
case2:
vc.push_back('*'); break;
case3:
vc.push_back('/'); break;
default:
cout<<"IMPOSSIBLE!\N";
}
}
for(i=0;i
cout<
cout<
boolt=true;
inttemp=0;
for(i=0;i
if(vc.at(i)=='*'||vc.at(i)=='/')
{
if(vc.at(i)=='*')
{
temp=vs.at(i)*vs.at(i+1);
}
else
{
temp=vs.at(i)/vs.at(i+1);
}
//cout<<"test"<
si=vs.begin()+i+1;
si=vs.erase(si);
ci=vc.begin()+i;
ci=vc.erase(ci);
i--;
}
}