编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#3279 #1006. 超级强迫症 Compile Error 0 0 ms 0 K C / 359 B s230026068 2023-11-25 14:31:09
显示原始代码
#include <stdio.h>
int main(int argc, char *argv[]) {
    int N, x = 0;
    int count = 0;
    char A[100];
    scanf("%d", &N);

    for (int i = 0;; i++) {
        scanf("%d", &A[i]);
        if (A[i] == '\n')
            break;
    }

    while (A[x] == A[x + 1]) {
        x++;
        count++;
        if (A[i] == '\n')
            break;
    }

    if (count == N) {
        printf("Yes");
    } else
        printf("No");

    return 0;
}

编译信息

/sandbox/1/a.c:9:14: warning: format specifies type 'int *' but the argument has type 'char *' [-Wformat]
                scanf("%d",&A[i]);
                       ~~  ^~~~~
                       %s
/sandbox/1/a.c:17:8: error: use of undeclared identifier 'i'
                if(A[i]=='\n')
                     ^
1 warning and 1 error generated.