编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#1719 #992. 鱼塘 Compile Error 0 0 ms 0 K C++ 17 / 496 B t330033013 2023-10-15 16:45:25
显示原始代码
#include <stdio.h>
int main() {
    int a, b, c, s, t;
    char o;
    scanf("%d %d %d", &a, &b, &c);
    t = 4;
    while (t > 0) {
        t = t - 1;
        if (t == 3)
            s = a;
        if (t == 2)
            s = b;
        if (t == 1)
            s = c;
        if (s % 4 == 0)
            o = ("%c", L);
        if (s % 4 == 1)
            o = ("%c", X);
        if (s % 4 == 2)
            o = ("%c", M);
        if (s % 4 == 3)
            o = ("%c", T);
        printf("%c", o);
    }

    return 0;
}

编译信息

/sandbox/1/a.cpp: In function 'int main()':
/sandbox/1/a.cpp:17:21: error: 'L' was not declared in this scope
   17 |             o=("%c",L);
      |                     ^
/sandbox/1/a.cpp:19:21: error: 'X' was not declared in this scope
   19 |             o=("%c",X);
      |                     ^
/sandbox/1/a.cpp:21:21: error: 'M' was not declared in this scope
   21 |             o=("%c",M);
      |                     ^
/sandbox/1/a.cpp:23:21: error: 'T' was not declared in this scope
   23 |             o=("%c",T);
      |                     ^
/sandbox/1/a.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |     scanf("%d %d %d",&a,&b,&c);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~