hdu 2000 ASCII码排序

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2000

题目大意:按各字符的ASCII码从小到大的顺序进行排序 注意格式哦!输出时字符中间用一个空格分开

 1 #include<stdio.h>
 2 int main()
 3 {
 4     char a,b,c,t;
 5     while(scanf("%c%c%c",&a,&b,&c)!=EOF)
 6     {
 7         getchar();
 8         if(a>b)
 9         {
10             t=a;
11             a=b;
12             b=t;
13         }
14         if(b>c)
15         {
16            t=b;
17            b=c;
18            c=t;
19         }
20         if(a>b)
21         {
22            t=a;
23            a=b;
24            b=t;
25         }
26         printf("%c %c %c
",a,b,c);
27     }
28     return 0;
29 }