#include "stdio.h"
int main()
{
char max,x,y,z;
scanf("%c%c%c",&x,&y,&z);
while( scanf(%c%c%c,&x,&y,&z)!=EOF)
{
if( 'x'>'y' )
if( 'y'>'z')
printf("%c %c %c\n",z,y,x);
else if( 'x'>'z' )
printf("%c %c %c\n",y,z,x);
else printf("%c %c %c\n",y,z,x);
else if( 'y'<'z' )
printf("%c %c %c\n",x,y,z);
else if( 'x'>'z' )
printf("%c %c %c\n",z,x,y);
else printf("%c %c %c\n",x,z,y);
}
return 0;
}
while( scanf(%c%c%c,&x,&y,&z)!=EOF)
这里 scanf("%c%c%c",……) 缺失引号
这已经不是算法的问题了,语言写法就不对吧。
scanf接收的写法不对,而且接收了两遍,那么第一遍就相当于被抹去了,而且比较xyz两个变量的条件表达式简直超神了!