//回车被当做字符
#include <stdio.h>
int main()
{
char a,b,c,d,x,y,z;
while (scanf("%c%c%c",&a,&b,&c) != EOF)
{
getchar();
x = a < b ? a:b;
x = x < c ? x:c;
z = a > b ? a:b;
z = z > c ? z:c;
y = a + b + c - x - z;
printf("%c %c %c\n",x,y,z);
}
}
/*#include <stdio.h>
int main()
{
char a,b,c,d,x,y,z;
while(scanf("%c%c%c%c",&a,&b,&c,&d) != EOF)
{
x=a<b?a:b;
x=x<c?x:c;
z=a>b?a:b;
z=z>c?z:c;
y=a+b+c-x-z;
printf("%c %c %c\n",x,y,z);
}
}
//超时
/*#include <stdio.h>
#include <string.h>
int main()
{
char a[10000];
gets(a);
while(a[0] != EOF)
{
int i = 0,j = 0;
int n;
char temp;
n = strlen(a);
for (i = 0;i < n;i++)
for(j = i;j < n;j++)
{
if (a[i] > a[j+1])
{
temp = a[i];
a[i] = a[j+1];
a[j+1] = temp;
}
}
for(i = 1;i <= n;i++)
printf("%c ",a[i]);
printf("\n");
gets(a);
}
}
*/
回车被当做字符读入,导致排序有问题。。用getchar();来吸收一个回车符号