hdoj-1070-Balloon Comes!
来源:互联网 发布:地下水埋深数据 编辑:程序博客网 时间:2024/05/18 13:31
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
#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>using namespace std;int main(){ int t; scanf("%d",&t); while(t--) { getchar(); char c; int a,b; scanf("%c",&c); scanf("%d%d",&a,&b); if(c=='+') { printf("%d\n",a+b); } else if(c=='-') { printf("%d\n",a-b); } else if(c=='/') { if(a%b==0) printf("%d\n",a/b); else { double n=double(a)/b; printf("%.2lf\n",n); } } else if(c=='*')printf("%d\n",a*b); } return 0;}
0 0
- hdoj-1070-Balloon Comes!
- HDOJ Balloon Comes!
- HDOJ 1170 Balloon Comes!
- HDOJ 1170 Balloon Comes!
- hdoj.1170 Balloon Comes! 20140812
- hdoj 1170 Balloon Comes!(水)
- HDOJ 1170 Balloon Comes!C++版
- HDOJ 1170 Balloon Comes!(c++)
- Balloon Comes!
- Balloon Comes!
- Balloon Comes!
- Balloon Comes!
- Balloon Comes!
- Balloon Comes!
- Balloon Comes!
- Balloon Comes!
- Balloon Comes!
- Balloon Comes!
- 虚拟机下网络连接不上
- 有关iphone表情符号的处理
- LeetCode - Binary Tree Level Order Traversal
- 读书笔记-数据结构C语言版
- 使用CocoaPods管理依赖库
- hdoj-1070-Balloon Comes!
- android天气预报获取-气象台webservice
- caffe绘制训练过程的loss和accuracy曲线
- 用Jenkins CI构建持续集成的flask项目
- 1.1.2 Linux之前UNIX的历史(2)
- Hibernate使用复合主键时需要注意的
- 排序算法-归并排序
- iOS webView中JavaScript打开原生ViewController(升级版)
- Linux学习笔记知识点(find命令)