mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
22 lines
447 B
C++
22 lines
447 B
C++
#include<stdio.h>
|
|
int main()
|
|
{
|
|
int n,a,b;
|
|
char c;
|
|
scanf("%d",&n);
|
|
while(n--)
|
|
{
|
|
getchar();
|
|
scanf("%c%d%d",&c,&a,&b);
|
|
if(c=='+')
|
|
printf("%d\n",a+b);
|
|
else if(c=='-')
|
|
printf("%d\n",a-b);
|
|
else if(c=='*')
|
|
printf("%d\n",a*b);
|
|
else
|
|
a%b?printf("%.2lf\n",a*1.0/b):printf("%d\n",a/b);
|
|
}
|
|
return 0;
|
|
}
|