您的位置:首页 > 其它

水题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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: