ANSⅡ码排序

来源:互联网 发布:系统更新软件 编辑:程序博客网 时间:2024/06/18 02:36
#include <stdio.h>#include <stdlib.h>int main(){    char x,y,z,temp;    while(scanf("%c%c%c",&x,&y,&z)!=EOF)        {if(x<y){temp=x;x=y;y=temp;}         if(x<z){temp=x;x=z;z=temp;}         if(y<z){temp=y;y=z;z=temp;}         printf("%c %c %c\n",z,y,x);         scanf("%c",&x)  /*消除最后输入的换行符的影响,若无此行,程序运行第一次结果正确,以后结果都是错误的*/        }        return 0;}
原创粉丝点击