编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#2384 #1001. 中心字母 Compile Error 0 0 ms 0 K C / 189 B t330026092 2023-11-17 12:25:31
显示原始代码
#include <stdio.h>

int main() {
    char a[99];
    int i = 0;
    scanf_s("%s", a);
    do {
        i++;
    } while (a[i] != '\0');
    if (i % 2 != 0) {
        printf("%c\n", (a[(i - 1) / 2]));
    }
    return 0;
}

编译信息

/sandbox/1/a.c:6:2: warning: implicit declaration of function 'scanf_s' is invalid in C99 [-Wimplicit-function-declaration]
        scanf_s("%s", a);
        ^
1 warning generated.
/usr/bin/ld: /tmp/a-53ae42.o: in function `main':
a.c:(.text+0x10): undefined reference to `scanf_s'
clang: error: linker command failed with exit code 1 (use -v to see invocation)