Problem C: 零起点学算法18——3个数比较大小

#include<stdio.h>
int main()
{
    int a,b,c;
    while(scanf("%d %d %d",&a,&b,&c)!=EOF)
    if(a<b){
        int flag=a;
         a=b;
        b=flag;    
    }
    if(a<c){
        int flag=a;
        a=c;
        c=flag;
    }
    if(b<c){
        int flag=b;
        b=c;
        c=flag;
    }
    printf("%d %d %d",a,b,c);
    return 0;
} 

 

posted @ 2018-10-05 11:35  MichaelCecil  阅读(1306)  评论(0编辑  收藏  举报