c 分 大佬们帮忙看看 谢谢了

P4414 [COCI2006-2007#2] ABC

palpitate_sl @ 2024-11-21 21:21:17

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
    int a, b, c;
    char ch;
    scanf("%d %d %d", &a, &b, &c); getchar();
    int zj;
    if (a > b)
    {
        zj = a; a = b; b = zj;
    }
    if (a > c)
    {
        zj = a; a = c; c = zj;
    }
    if (b > c)
    {
        zj = b; b = c; c = zj;
    }
    ch = getchar();
    while (ch!= '\n')
    {
        switch (ch)
        {
        case 'A': printf("%d ", a); break;
        case 'B': printf("%d ", b); break;
        case 'C': printf("%d ", c); break;
        default:printf("输入错误");
        }
        ch = getchar();
    }
    return 0;
}

|