欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

abc sort

程序员文章站 2022-04-02 22:35:39
c: #include//从大到小 int main(){ int a, b, c; int x = 0; printf("input message:\n"); scanf("%d %d %d", &a, &b, &c); if(a < b) { x = a; a = b; b ......

c:

#include<stdio.h>
//从大到小
int main()
{
int a, b, c;
int x = 0;

printf("input message:\n");
scanf("%d %d %d", &a, &b, &c);

if(a < b)
{
x = a;
a = b;
b = x;
}
if(a < c)
{
x = a;
a = c;
c = x;
}
if(b < c)
{
x = b;
b = c;
c = x;
}

printf("output message:\n %d %d %d", a, b, c);

return 0;
}