输入三个数,由大到小排列

Posted zyz322

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了输入三个数,由大到小排列相关的知识,希望对你有一定的参考价值。

#include "stdio.h"
void main()
{
  int a,b,c,t;
  scanf("%d%d%d",&a,&b,&c);
  if(a>b)
  { t=b;
    b=a;
    a=t;
  }
  if(a>c)
  {
      t=a;
      a=c;
      c=t;
  
  }
  if(b>c)
  {
    t=b;
    b=c;
    c=t;
  }
  printf("由小到大顺序为:
");
  printf("%d %d %d
",a,b,c);
}

 

以上是关于输入三个数,由大到小排列的主要内容,如果未能解决你的问题,请参考以下文章