请问为啥运行不对,题:假设每班人数最多不超过40人,具体人数由键盘输入,打印最高分和学号
#include <stdio.h>void f(char c[10],int *p )
{
int max,i;
char x[100];
max=*p,x[0]=c[0];
for(i=0;i<40;i++)
if (max<*p)
{
max=*p;
x[0]=c[i];
}
printf("%s%d\n",x[0],max);
}
void main()
{
int a[100],i,n;
char b[100];
printf("the number of people(<=40)\n");
scanf("%d\n",&n);
printf("input the student number and grade\n ");
for (i=0;i<n;i++)
{
scanf("%s%d\n",b[i],a[i]);
}
f(b,a);
}