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

Posted chenlong991223

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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;
} 

 

以上是关于Problem C: 零起点学算法18——3个数比较大小的主要内容,如果未能解决你的问题,请参考以下文章