标签:font ase number data strong mono printf tom pos
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 23182 Accepted Submission(s): 8774
4 + 1 2 - 1 2 * 1 2 / 1 2
3 -1 2 0.50
#include<stdio.h>
int main()
{
int n,a,b;
char k;
scanf("%d",&n);
while(n--)
{
getchar();
scanf("%c %d%d",&k,&a,&b);
if(k==‘+‘)
printf("%d\n",a+b);
if(k==‘-‘)
printf("%d\n",a-b);
if(k==‘*‘)
printf("%d\n",a*b);
if(k==‘/‘)
{
if(a%b==0)
printf("%d\n",a/b);
else
printf("%.2f\n",a*1.0/b);
}
}
return 0;
}
标签:font ase number data strong mono printf tom pos
原文地址:http://www.cnblogs.com/lytwajue/p/6919691.html