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. RESTful API 设计最佳实践(转)

    摘要:目前互联网上充斥着大量的关于RESTful API(为了方便,以后API和RESTful API 一个意思)如何设计的文章,然而却没有一个”万能“的设计标准:如何鉴权?API格式如何?你的API ...

  2. vimdiff

    [vimdiff] 启动方法 首先保证系统中的diff命令是可用的.Vim的diff模式是依赖于diff命令的.Vimdiff的基本用法就是: # vimdiff FILE_LEFT FILE_RIG ...

  3. LeetCode292:Nim Game

    You are playing the following Nim Game with your friend: There is a heap of stones on the table, eac ...

  4. AJAX小练习,防止以后忘记

    <div id="content"> <input id="btnShow" type="button" value=&q ...

  5. oradmin相关用法

    [转]oradmin相关用法 创建例程: -NEW -SID sid | -SRVC 服务 [-INTPWD 口令] [-MAXUSERS 数量] [-STARTMODE a|m] [-PFILE 文 ...

  6. UVa 297 - Quadtrees

    题目:利用四叉树处理图片,给你两张黑白图片的四叉树,问两张图片叠加后黑色的面积. 分析:搜索.数据结构.把图片分成1024块1*1的小正方形,建立一位数组记录对应小正方形的颜色. 利用递归根据字符串, ...

  7. hdu 5407

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5407 题意:给定一个数n,求LCM(C(n,0),C(n,1),C(n,2)...,C(n,n)) 根 ...

  8. easyui 表单和自定义验证扩展和js自定义返回值

    ================jsp==========================<form  method="post" id="regfrminp&qu ...

  9. PowerDesigner 12.5 反向工程sql server

    一.设置数据源 1.控制面板 >> 数据源(ODBC)

  10. ASP.NET MVC- KindEditor的使用

    我用过几个EDITOR,还是比较喜欢KINDEDITOR.这个工作可能最近要用到了,周末在家花时间了解了一下.做了一下备注在这里,以备日后方便查阅. 1.首先去KINDEDITOR的官网下载最新的版本 ...