码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2018-10-05 13:49:21      阅读:356      评论:0      收藏:0      [点我收藏+]

标签:code   color   include   算法   ble   int   problem   col   print   

#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个数比较大小

标签:code   color   include   算法   ble   int   problem   col   print   

原文地址:https://www.cnblogs.com/chenlong991223/p/9744469.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!