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. ControlsFX8.0.2中对话框无法判断是否显示的修改

    在org.controlsfx.dialog.FXDialog.java中加入 public abstract boolean isShowing(); 在org.controlsfx.dialog. ...

  2. Python流程控制语句(Control Flow)

    Python用于流程控制的语句包括if,for,while,这些都是从C语言借鉴过来的,然后我们会提到pass语句. 1,if if的语法很简答,我们举一个例子就好,注意关键字if, elif, el ...

  3. Socket小项目的一些心得(鸣谢传智的教学视频)

    Socket是一种封装了四层通信的整体抽象入口,通常也称作"套接字",这是常用的四层通信这是访问Socket的流程图,这个分为客户端和服务器端,其中服务器端有以下步骤去建立,前面的 ...

  4. PostQueuedCompletionStatus

    PostQueuedCompletionStatus函数,向每个工作者线程都发送—个特殊的完成数据包.该函数会指示每个线程都“立即结束并退出”.下面是PostQueuedCompletionStatu ...

  5. android adb服务启动不了解决办法

    当然还有可能是其它的原因,下面是一些解决办法的汇总 因为在对应的文件夹下找不到adb的问题,将android-sdk/platform-tools和android-sdk/tools都加到环境变量中去 ...

  6. Odoo 开发者模式

    这里我们以Odoo V9介绍下Odoo的开发者模式: 进入开发者模式: 登录odoo系统后,点击右上角登陆账号下拉菜单,选择About,然后在弹出菜单里点击Activate the developer ...

  7. android ExpandAbleListView控件

    ExpandAbleListView控件 1.API对ExpandAbleListView的解释:

  8. C:函数指针、回调函数

    函数指针 是一个指针,指向函数的指针,指针存放的都是地址,所以函数指针存放的是函数的地址.数组名就是数组的首地址,函数名就是函数的首地址.与数组类似. 代码demo int (*p) (int ,in ...

  9. 获取select当前选择的值和文本

    <html> <head> <script type="text/javascript"> function EE(obj) { alert(& ...

  10. windows apache vhost 403 error

    <Directory D:\workspace\ecshop> Options FollowSymLinks AllowOverride None Order deny,allow all ...