编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#18198 #2015. shenchuan的CF段位 Compile Error 0 0 ms 0 K C (NOI) / 1.4 K 192024213485 2024-10-19 14:49:20
显示原始代码
#include <stdio.h>
int main() {
    int n;
    float arr[1000000000];
    scanf("%d\n", &n);
    for (int a = 0; a < n; a++) {
        scanf("%d\n", &arr[a]);
    }
    for (int b = 0; b < n; b++) {
        if (arr[b] >= 0 && arr[b] < 1200) {
            printf("Newbie No\n");
        } else if (arr[b] >= 1200 && arr[b] < 1400) {
            printf("Pupil No\n");
        } else if (arr[b] >= 1400 && arr[b] < 1600) {
            printf("Specialist No\n");
        } else if (arr[b] >= 1600 && arr[b] < 1700) {
            printf("Expert No\n");
        } else if (arr[b] >= 1700 && arr[b] < 1900) {
            printf("Expert Yes\n");
        } else if (arr[b] >= 1900 && arr[b] < 2100) {
            printf("Candidate Master Yes\n");
        } else if (arr[b] >= 2100 && arr[b] < 2300) {
            printf("Master Yes\n");
        } else if (arr[b] >= 2300 && arr[b] < 2400) {
            printf("International Master Yes\n");
        } else if (arr[b] >= 2400 && arr[b] < 2600) {
            printf("Gandmaster Yes\n");
        } else if (arr[b] >= 2600 && arr[b] < 3000) {
            printf("International Gandmaster Yes\n");
        } else if (arr[b] >= 3000 && arr[b] < 4000) {
            printf("Legendary Gandmaster Yes\n");
        } else {
            printf("Tourist Yes\n");
        }
    }
    return 0;
}

编译信息

/sandbox/1/a.c: In function 'main':
/sandbox/1/a.c:5:11: error: size of array 'arr' is too large
     float arr[1000000000];
           ^
/sandbox/1/a.c:7:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for(int a=0;a<n;a++)
     ^
/sandbox/1/a.c:7:5: note: use option -std=c99 or -std=gnu99 to compile your code
/sandbox/1/a.c:11:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for(int b=0;b<n;b++)
     ^
/sandbox/1/a.c:6:10: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d\n",&n);
          ^