杭电ACM1170--Balloon Comes!

地址  http://acm.hdu.edu.cn/showproblem.php?pid=1170

#include<stdio.h>
int main()
{
    int t,a,b;
    char m[2];
    scanf("%d",&t);
    while(t--)
    {
        scanf("%s%d%d",m,&a,&b);
        if(m[0]=='+') printf("%d\n",a+b);
        else if(m[0]=='-') printf("%d\n",a-b);
        else if(m[0]=='*') printf("%d\n",a*b);
        else if(a/b*b==a) printf("%d\n",a/b);
        else printf("%.2f\n",(double)a/b);
    }
    return 0;
}

 




 

posted @ 2015-11-22 10:38  小小暮雨  阅读(264)  评论(0编辑  收藏  举报