#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> int main() { int t; scanf("%d",&t); int k=t; while(k--) { int a,b; char s[1]; scanf("%d %c %d",&a,s,&b); if(s[0]=='+') { printf("%d\n",a+b); } else if(s[0]=='-') { printf("%d\n",a-b); } } return 0; } |
Double click to view unformatted code.