#include<stdio.h>
int main()
{
char ch[3],temp;
while(scanf("%c%c%c",&ch[0],&ch[1],&ch[2])!=EOF)
{
if(ch[0]>ch[1])
{
temp=ch[0];
ch[0]=ch[1];
ch[1]=temp;
}
if(ch[0]>ch[2])
{
temp=ch[0];
ch[0]=ch[2];
ch[2]=temp;
}
if(ch[1]>ch[2])
{
temp=ch[1];
ch[1]=ch[2];
ch[2]=temp;
}
printf("%c %c %c\n",ch[0],ch[1],ch[2]);
getchar();
}
return 0;
}
冒泡第一次还写错了……
赋值的时候一定要注意!