地址 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 ",a+b); else if(m[0]=='-') printf("%d ",a-b); else if(m[0]=='*') printf("%d ",a*b); else if(a/b*b==a) printf("%d ",a/b); else printf("%.2f ",(double)a/b); } return 0; }