/////////////參考解法///////////
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main()
{
int n = 0;
char input[20000] = { '\0' }, output_1[10000] = { '\0' }, output_2[10000] = { '\0' };
char op;
int a = 0, b = 0, output = 0;
scanf("%d", &n);
getchar();
while (n)
{
a = 0;
b = 0;
int count = 0;
gets_s(input);
int i = 0, j = 0, temp = 0;
for (i = 0; i < strlen(input); i++)
{
if (input[i] >= '0' && input[i] <= '9')
{
output_1[count] = input[i];
count++;
}
else if (input[i] == '+' || input[i] == '-' || input[i] == '*' || input[i] == '/' || input[i] == '%')
{
op = input[i];
i++;
break;
}
}
count = 0;
for (j = i; j < strlen(input); j++)
{
if (input[j] >= '0' && input[j] <= '9')
{
output_2[count] = input[j];
count++;
}
}
a = atoi(output_1);
b = atoi(output_2);
switch (op)
{
case '+':
output = a + b;
break;
case'-':
output = a - b;
break;
case'*':
output = a * b;
break;
case'/':
output = a / b;
break;
case'%':
output = a % b;
break;
defalt:
break;
}
printf("%d\n", output);
n--;
memset(output_1, '\0', sizeof(output_1));
memset(output_2, '\0', sizeof(output_2));
}
return 0;
}