p4414为啥测试点7过了,但是其他都错,对了对测试点1的答案是对的但是判错.

P4414 [COCI2006-2007#2] ABC

xingluekaishi @ 2024-11-03 11:36:08

#include<stdio.h>
int main()
{
    int x, y, z;
    scanf("%d %d %d", &x, &y, &z);
    if (x > y)
    {
        x = x ^ y;
        y = x ^ y;
        x = x ^ y;
    }
    if (y > z)
    {
        y = y ^ z;
        z = y ^ z;
        y = y ^ z;
    }
    if (x > y)
    {
        x = x ^ y;
        y = x ^ y;
        x = x ^ y;
    }
    char A, B, C;
    while ((A = getchar()) == '\n');
    B = getchar();
    C = getchar();
    if (A > B && A > C && B > C)
        printf("%d %d %d", z, y, x);
    if (A > B && A > C && C > B)
        printf("%d %d %d", z, x, y);
    if (B > A && B > C && A > C)
        printf("%d %d %d", y, z, x);
    if (B > A && B > C && C > A)
        printf("%d %d %d", x, z, y);
    if (C > A && C > B && A > B)
        printf("%d %d %d", y, x, z);
    if (C > A && C > B && B > A)
        printf("%d %d %d", x, y, z);
    return 0;
}

by zichen3004 @ 2024-11-03 11:49:23

建议你把记录和数据贴上来。


by da_cong @ 2024-11-03 12:00:47

@xingluekaishi 代码写出顶真句了


by xingluekaishi @ 2024-11-03 15:24:48

测试点1数据 输入: 1 2 3 ABC 输出: 1 2 3


|