学号那一项该怎么改才正确。
#include <stdio.h>
#define N 30
int ave(int a);
int i, max;
float a, b, c, d, e, f;
int score[N];
char name[N][10];
int number[N][1];
int main () {
int counter1 = 0, counter2 = 0, counter3 = 0, counter4 = 0, counter5 = 0, counter6 = 0;
for (i = 0; i < N; i++) {
printf ("名字:\t");
scanf ("%s", &name[i]);
printf("成绩:\t");
scanf("%d", &score[i]);
printf("学号:\t");
scanf("%d", &number[i]);
if (score[i] < 0)
break;
else if (score[i] >= 90)
counter1++;
else if (score[i] >= 80)
counter2++;
else if (score[i] >= 70)
counter3++;
else if (score[i] >= 60)
counter4++;
else
counter5++;
}
int p, j;
f = ave(a);
for (p = 0; p < N; p++) {
if (score[p] > f)
counter6++;
}
max = score[0];
for (j = 0; j < N; j++) {
if (max < score[j])
max = score[j];
}
a = (counter1 * 100.0 / N);
b = (counter2 * 100.0 / N);
c = (counter3 * 100.0 / N);
d = (counter4 * 100.0 / N);
e = (counter5 * 100.0 / N);
printf("最高分是:%d分,其学号为:%d\n", max, number[i]);
printf("不及格有:%d人,所占百分比为:%.2f%%\n", counter5, e);
printf("分数>=90占百分比为:%.2f%%\n", a);
printf("90>分数>=80占百分比为:%.2f%%\n", b);
printf("80>分数>=70占百分比为:%.2f%%\n", c);
printf("70>分数>=60占百分比为:%.2f%%\n", d);
printf("在平均分数之上的有:%d人\n", counter6);
return 0;
}
int ave(int a) {
int total = 0, i, b;
for (i = 0; i < N; i++) {
total += score[i];
}
b = total / N;
return b;
}