汪东波吧 关注:13贴子:377
  • 0回复贴,共1
#include<stdio.h>
int main()
{
int a,b,n;
char c;
while(scanf("%d",&n)!=EOF){
while(n){
n--;
scanf("%d%c%d",&a,&c,&b);
/*****字符用单引号,相对于1001,1002,这题完全没有难度**********/
if(c=='+')
printf("%d\n",a+b);
if(c=='-')
printf("%d\n",a-b);
if(c=='*')
printf("%d\n",a*b);
if(c=='/')
printf("%d\n",a/b);
}
}
return 0;
}


IP属地:江苏1楼2015-01-10 18:06回复