在一个二维数组中保存了 N 个工人和 M 个项目的工作时间,工人的名字保存在一个名为 Worker 的数组中,项目的名称保存在一个名为“Project”的数组中。写一个读取数据并显示工人工作时间更长的程序。所以我尝试了这个,但每次我运行它,这似乎是一个逻辑错误,因为它说:给出项目的编号,如果我输入“2 “这也是根据我的程序的工人数量,然后它要求每个工人的小时数..
#include<stdio.h>
#include<conio.h>
int main()
{
    int i, j, n, worker[100][10], hours[30][100];
    printf("The number of the project: ");
    scanf("%d", &n);
    for (i=0; i<n; i++)
    {
        printf("Give the worker %d: ", i+1);
        scanf("%s", &worker[i]);
    }
    for (i=0; i<n; i++)
    {
        printf("\n The worker  %s\n", worker[i]);
        for (j=0; j<30; j++)
        {
            printf("The number of the hours for the day %d: ", j+1);
            scanf("%d", &hours[i][j]);
        }
    }
    for (i=0; i<n; i++)
    {
        for (j=0; j<30; j++)
            if (hours[i][j]==0)
                break;
        if (j==30)
            printf("%s\n", worker[i]);
    }
    getch();
    return 0;   
}