水题hdoj-2000、hdoj-2002、hdoj-2003、hdoj-2004
2016-03-26 22:20
471 查看
//hdoj-2000 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; char a[5]; int main() { while(scanf("%s", a)!=EOF) { sort(a,a+3); for(int i = 0; i < 3; i++) printf(i!=2?"%c ":"%c", a[i]); printf("\n"); } return 0; }
//hdoj-2002 #include<stdio.h> #define PI 3.1415927 int main() { double x; while(scanf("%lf", &x)!= EOF) { printf("%.3lf\n", (4.0/3*PI*x*x*x)); } return 0; }
//hdoj-2003 #include<stdio.h> int main() { double x; while(scanf("%lf", &x)!=EOF) { printf("%.2lf\n", x>0?x:-x); } return 0; }
//hdoj-2004 #include<stdio.h> int main() { int x; while(scanf("%d",&x)!=EOF) { if(x<0 || x>100) printf("Score is error!\n"); else { int t; switch(x/10) { case 10: case 9: t = 0; break; case 8: t = 1; break; case 7: t = 2; break; case 6: t = 3; break; default: t = 4; break; } printf("%c\n", 'A'+t); } } return 0; }
相关文章推荐
- git使用常见错误及修复
- C# - 时间格式
- HDU5651 xiaoxin juju needs help 组合
- 不安全感 人无癖不可与交 人生不是一场马拉松 [20160326]
- C语言笔记(一)
- java中的nextLine
- Cannot instantiate the type
- LINQ中的一些查询语句格式
- 在mac下搭建Apache服务器
- eclipse+安卓开发环境搭建
- hadoop生态系统学习之路(二)如何编写MR以及运行测试
- PE 530
- Nginx+PHP+mysql
- error RC2108: expected numerical dialog constant
- Android View的几个位置坐标关系
- 根据经纬度和半径计算经纬度范围,根据两点经纬度计算距离
- Longest Increasing Subsequence(DP)
- Codeforces#103-C. Anagram Search-乱搞水题
- 使用CSS3实现响应式标题全屏居中和网站前端性能
- 2016总计划(二)