将三个数从大到小输出(C语言)

将三个数从大到小输出(C语言)

#include
int main()
{
 int a = 0;
 int b = 0;
 int c = 0; 
 int m = 0;
 printf("请输入三个数:\n");
 scanf_s("%d%d%d", &a, &b, &c);
 if (a < b)
 {
  m = a; 
  a = b;
  b = m;
 }
 if (a < c)
 {
  m = a;
  a = c;
  c = m;
 }
 if (b < c);
 {
  m = b;
  b = c;
  c = m;
 }
 printf("%d\n%d\n%d\n", a, b, c);
 return 0;
}

你可能感兴趣的:(C语言)