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;
}
推荐阅读