样例过了但是全WA,求助大佬们
查看原帖
样例过了但是全WA,求助大佬们
1174913
Viraag楼主2023/11/18 10:44
#include <stdio.h>
int main()
{
    int n;
    scanf("%d", &n);
    int prize[7];
    for(int i = 0; i < 7; i++) {
        scanf("%d", &prize[i]);
    }
    int a[n][7];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 7; j++) {
            scanf("%d", &a[i][j]);
        }
    }
    int count[6];
    for (int i = 0; i < 6; i++) {
        count[i] = 0;
    }
    for (int i = 0; i < n; i++) {
        int temp = 0;
        for (int j = 0; j < 7; j++) {
            for (int k = 0; k < 7; k++) {
                if (a[i][j] == prize[k]) {
                    temp++;
                }
            }
        }
        if (temp == 6) {
            count[0]++;
        } else if (temp == 5) {
            count[1]++;
        } else if (temp == 4) {
            count[2]++;
        } else if (temp == 3) {
            count[3]++;
        } else if (temp == 2) {
            count[4]++;
        } else if (temp == 1) {
            count[5]++;
        }
    }
    for (int i = 0; i < 6; i++) {
        printf("%d ", count[i]);
    }
    return 0;
}

球球大佬捞捞

2023/11/18 10:44
加载中...