Problem Description
The contest starts now! How excited it is to see balloons floating around. You, one of the best programmers in HDU, can get a very beautiful balloon if only you have solved the very very very... easy problem.
Give you an operator (+,-,*, / --denoting addition, subtraction, multiplication, division respectively) and two positive integers, your task is to output the result. 
Is it very easy? 
Come on, guy! PLMM will send you a beautiful Balloon right now!
Good Luck!
 
Input
Input contains multiple test cases. The first line of the input is a single integer T (0<T<1000) which is the number of test cases. T test cases follow. Each test case contains a char C (+,-,*, /) and two integers A and B(0<A,B<10000).Of course, we all know that A and B are operands and C is an operator. 
 
Output
For each case, print the operation result. The result should be rounded to 2 decimal places If and only if it is not an integer.
 
Sample Input
4
+ 1 2
- 1 2
* 1 2
/ 1 2
 
Sample Output
3
-1
2
0.50
 
 #include <stdio.h>

 int main(){
int T;
char c;
int a;
int b; scanf("%d",&T); while(T--){
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 if(c=='/'){
if(a%b!=)
printf("%.2lf\n",(double)a/b); else
printf("%d\n",a/b);
}
}
return ;
}

Balloon Comes!的更多相关文章

  1. HDOJ 1004 Let the Balloon Rise

    Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...

  2. hdu 1004 Let the Balloon Rise

    Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Oth ...

  3. 【ZOJ1003】Crashing Balloon(DFS)

    Crashing Balloon Time Limit: 2 Seconds      Memory Limit: 65536 KB On every June 1st, the Children's ...

  4. Let the Balloon Rise

    Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...

  5. 杭电1170 Balloon Comes

    Problem Description The contest starts now! How excited it is to see balloons floating around. You, ...

  6. Let the Balloon Rise 分类: HDU 2015-06-19 19:11 7人阅读 评论(0) 收藏

    Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Oth ...

  7. HDU 1004 Let the Balloon Rise map

    Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Oth ...

  8. HDU1004 Let the Balloon Rise(map的简单用法)

    Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...

  9. jQuery:balloon气泡提示插件

    插件下载地址:http://file.urin.take-uma.net/jquery.balloon.js-Demo.html <!DOCTYPE html PUBLIC "-//W ...

  10. HD1004Let the Balloon Rise

    Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...

随机推荐

  1. IDE Plug

    IDE Plug 使用 cnpack提供的IDE External Wizard Management 管理插件.添加插件.删除插件 Cnpack D:\Program Files (x86)\CnP ...

  2. bpl

    RegisterClass LoadPackage Getprocaddress FindClass UnRegisterModuleClasses UnloadPackage

  3. linux top命令VIRT,RES,SHR,DATA的含义

    VIRT:virtual memory usage 虚拟内存1.进程“需要的”虚拟内存大小,包括进程使用的库.代码.数据等2.假如进程申请100m的内存,但实际只使用了10m,那么它会增长100m,而 ...

  4. Linux下的sort排序命令详解(二)

    有时候学习脚本,你会发现sort命令后面跟了一堆类似-k1,2,或者-k1.2 -k3.4的东东,有些匪夷所思.今天,我们就来搞定它—-k选项! 1 准备素材 [root@FDMdevBI opt]# ...

  5. oracle 去掉空格

    trim(value) 去掉左右空格 ltrim(value) 去掉左空格 rtrim(value) 去掉右空格

  6. ESP8266调试问题

    1 串口连接电脑调试时,GPIO15必须接地,否则没响应 2发送退出透传指令“+++”时,必须取消勾选发送新行.发送别的指令时须勾选. 另外若所刷固件版本为[Vendor:www.ai-thinker ...

  7. Keil MDK Code、RO-data、RW-data、ZI-data数据段

      Program Size: Code=10848 RO-data=780 RW-data=372 ZI-data=868   Code 表示程序代码指令部分 存放在Flash区 RO-data 表 ...

  8. 代码中设置excel自定义格式为[红色]的处理方法

    有时候,excel的自定义格式设置时 ,会遇到需要设置为¥#,##0;[红色]¥-#,##0的格式. 其中会带一个颜色标记,但是如果这样的一句代码,放在英文版的Office里面,就失效了,因为英文版应 ...

  9. hdoj 5317 RGCDQ

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5317 #include<stdio.h> ; int F[MAXN]; bool flag ...

  10. 使用struts dojo ajax源码案例

    我这里使用的jar 包struts2-dojo-plugin-2.2.1.1.jar ===========jsp======================= <%@ taglib prefi ...