水题hdoj-2000、hdoj-2002、hdoj-2003、hdoj-2004

//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; 
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值