非语法错误,错在哪里?
#include <stdio.h>#include <stdlib.h>
struct Information
{
int num;
char name[20];
char sex;
float score[3];
float average;
}person[4];
void Input(struct Information *p,int n);
int main()
{
Input(person,4);
}
void Input(struct Information *p,int n) /*对结构体内的变量赋值*/
{
int i;
char temp[4];
for(i=0;i<4;i++,p++)
{
printf("Input No.%d:",i+1);
gets(temp);
p->num=atoi(temp);
printf("Input the name:");
gets(p->name);
printf("Input the sex:");
p->sex=getchar();
while(getchar()!='\n')
continue;
printf("Input three scores:");
scanf("%f%f%f",p->score[0], p->score[1],p->score[2]);
}
}