#include<stdio.h>
#include<stdlib.h>
int main()
{
int a[100],b[100] ,c[100],n,i;
int w=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %d %d",&a[i],&b[i],&c[i]);
}
for(i=0;i<n;i++){
if(a[i]==1){
w=b[i]+c[i];
printf("%d\n",w);
}else if(a[i]==2){
w=b[i]-c[i];
printf("%d\n",w);
}else if(a[i]==3){
w=b[i]*c[i];
printf("%d\n",w);
}else if(a[i]==4){
w=b[i]/c[i];
printf("%d\n",w);
}
}
system("PAUSE");
return 0;
}
system("PAUSE");
zerojudge不能用system指令