NYOJ--4
原题链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=4
ASCII码排序
1 #include<stdio.h> 2 int main() 3 { 4 int t;char str[3],temp,a,b,c; 5 scanf("%d",&t); 6 while(t--) 7 { 8 scanf("%s",str);a=str[0];b=str[1];c=str[2]; 9 if(a>b){temp=a;a=b;b=temp;} 10 if(a>c){temp=a;a=c;c=temp;} 11 if(b>c){temp=b;b=c;c=temp;} 12 printf("%c %c %c\n",a,b,c); 13 } 14 return 0; 15 } 16