#include
#include
#include
using namespace std;
int main(){
srand(time(NULL));
int x=rand()%10;
int type;
cin>>type;
switch (type){
case 1:cout<<"+";break;
case 2:cout<<"-";break;
default :cout<<"Error";break;
}
int y=rand()%10;
cout<
int answer;
cin>>answer;
if (answer= x switch(type) y) cout<<"good";
else cout<<"Error";
}
我的想法是通过switch按照使用者意愿产生+或-...然后产生两个随机数x,y,让使用者计算x+y或者x-y的结果...红色那一行要怎么改~