输入三个数a,b,c,要示按由小到大的顺序输出

#include<stdio.h>
int main()
{
       double a,b,c,t;
       scanf("%lf %lf %lf",&a,&b,&c);
       if(a>b)
       {
          t=a;
          a=b;
          b=t;
       }
      if(a>c)
       {
          t=a;
          a=c;
          c=t;
       }

      if(b>c)
       {
          t=b;
          b=c;
          c=t;
       }
        printf("%f %f %f",a,b,c);
        return 0;
}

posted @ 2016-03-03 15:52  胡卫雄  阅读(1712)  评论(0编辑  收藏  举报