#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
using namespace std;
int main()
{
int t;
char c;
int a, b;
while(cin>>t)
{
while(t--)
{
cin>>c>>a>>b;
if(c == '+')
cout<<a + b<<endl;
else if(c == '-')
cout<<a - b<<endl;
else if(c == '*')
cout<<a * b<<endl;
else {
if(a % b == 0)
cout<<a/b<<endl;
else
{
double x = a, y = b;
printf("%.2lf\n", x / y);
}
}
}
}
return 0;
}
HDU 1170
最新推荐文章于 2020-07-21 12:05:42 发布