HDU 1170
来源:互联网 发布:淘宝网开店费用 编辑:程序博客网 时间:2024/06/15 08:18
Balloon Comes!
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!
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!
题意:输入符号和数字,计算结果。注意数字类型。
#include<stdio.h>int main(){ int a,b,c,i,n; double d; char e; while(scanf("%d",&n)!=EOF) { getchar(); for(i=1; i<=n; i++) { d=0; scanf("%c %d %d",&e,&a,&b); getchar(); switch(e) { case '+': printf("%d\n",a+b); break; case '-': printf("%d\n",a-b); break; case '*': printf("%d\n",a*b); break; case '/': { if(a/b*b!=a) printf("%.2lf\n",(double)a/b); else printf("%d\n",a/b); } break; } } }}
1 0
- hdu 1170
- hdu 1170
- hdu 1170
- HDU 1170
- HDU 1170
- HDU 1170
- HDU 1170
- HDU 1170
- HDU 1170 Balloon Comes!
- HDU 1170 ( Balloon Comes! )
- HDU 1170 Balloon Comes!
- HDU 1170 Balloon Comes!
- HDU 1170(水题)
- HDU 1170Balloon Comes!
- HDU 1170 Balloon Comes!
- HDU 1170 Balloon Comes!
- hdu 1170 Balloon Comes
- hdu-1170 Balloon Comes!
- javascript的window对象
- 刘同学请保重身体
- linux误挂载到根目录出现问题
- Android fontawesome-webfont.ttf字体库的使用
- 又见GCD
- HDU 1170
- MATLAB画双轴-倒立降水柱状图
- 用户名 不在 sudoers文件中,此事将被报告。
- 补noip2014day1、noip2014模拟day2
- 如何将excel数据导入mongoDB数据库?
- 无向图的邻接矩阵基本操作
- UVA-10025 The ? 1 ? 2 ? ... ? n = k problem
- 推荐系统
- Arm汇编 位置无关代码 adr 指令