标签:
//AC
#include "stdio.h"
int main(void){
char x, y, z, temp;
while(scanf("%c%c%c", &x, &y, &z) != EOF){
getchar();
if(x>y){
temp = x;
x = y;
y = temp;
}
if(x>z){
temp = x;
x = z;
z = temp;
}
if(y>z){
temp = y;
y = z;
z = temp;
}
printf("%c %c %c\n", x, y, z);
}
return 0;
}
//无法AC,提示Output Limit Exceeded! why?
#include "stdio.h"
int main(void){
char i, j, k;
char temp;
while(scanf("%c%c%c", &i, &j, &k) != ‘\n‘){ //如果换成while(scanf("%c%c%c", &i, &j, &k) != EOF),则Wrong Answer
getchar();
temp = i<j?i:j;
printf("%c %c %c\n", temp<k?temp:k, temp<k?k:temp, i<j?j:i);
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/cnfanhua/p/4220916.html