#include <iostream>
using namespace std;
int main(){
long long int N = 0;
long long int a = 0,b = 0,c = 0;
cin >> N ;
do{
cin >> a >> b >> c;
if( b < 1 || c > 2147483647 || a < 1 || a > 4 ){
return 0 ;
}
switch(a){
case 1:
cout << b + c << endl;
break;
case 2:
cout << b - c << endl;
break;
case 3:
cout << b * c << endl;
break;
case 4:
cout << b / c << endl;
break;
}
N--;
}while( N > 0 );
}
#include
using namespace std;
int main(){
long long int N = 0;
long long int a = 0,b = 0,c = 0;
cin >> N ;
do{
cin >> a >> b >> c;
if( b < 1 || c > 2147483647 || a < 1 || a > 4 ){
return 0 ;
}
switch(a){
case 1:
cout << b + c << endl;
break;
case 2:
cout << b - c << endl;
break;
case 3:
cout << b * c << endl;
break;
case 4:
cout << b / c << endl;
break;
}
N--;
}while( N > 0 );
}
看起來很正確阿.