求解第二题,C语言的代码

img


#include "stdio.h"
main()
{
    int a, b, c, d, t;
    printf("请输入4个整数:");
    scanf("%d%d%d%d",&a, &b, &c, &d);
    if(a > b)
    { 
        t = a; 
        a = b; 
        b = a;
    }
    if(a > c)
    { 
        t = a; 
        a = c; 
        c = t;
    }
    if(a > d)
    { 
        t = a; 
        a = d; 
        d = t;
    }
    if(b > c)
    { 
        t = b; 
        b = c; 
        c = t;
    }
    if(b > d)
    { 
        t = b; 
        b = d; 
        d = t;
    }
    if(c > d)
    { 
        t = c; 
        c = d; 
        d = t;
    }
    printf("从小到大排序为:%d < %d < %d < %d\n",d, c, b, a);
}
#include <stdio.h>

int main()
{
    int x, y;
    scanf("%d%d", &x, &y);
    printf("%d %d", x > y ? x : y);
}