编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#1272 #996. 相似字符串 Compile Error 0 0 ms 0 K C / 542 B s230016006 2023-10-15 16:01:28
显示原始代码
#include <stdio.h>
int main() {
    int n;
    scanf("%d", &n);
    char a[n], b[n];
    scanf("%s", &a[n]);
    scanf("%s", &b[n]);
    for (int i = 0; i < n; i++) {
        if (a[i] == '0') {
            a[i] = 'o';
        }
        if (a[i] == '1') {
            a[i] = 'l';
        }
    }

    for (int i = 0; i < n; i++) {
        if (b[i] == '0') {
            b[i] = 'o';
        }
        if (b[i] == '1') {
            b[i] = 'l';
        }
    }

    if (strcpm(a[n], b[n]) > 0)
        ;
    printf("Yes");
    else printf("No");
}

编译信息

/sandbox/1/a.c:26:12: warning: implicit declaration of function 'strcpm' is invalid in C99 [-Wimplicit-function-declaration]
        if(strcpm(a[n],b[n])>0);
           ^
/sandbox/1/a.c:26:32: warning: if statement has empty body [-Wempty-body]
        if(strcpm(a[n],b[n])>0);
                               ^
/sandbox/1/a.c:26:32: note: put the semicolon on a separate line to silence this warning
/sandbox/1/a.c:28:9: error: expected expression
        else
        ^
2 warnings and 1 error generated.