结构体问题
#include <stdio.h>typedef struct Stuendt{
int no;
char name[20];
double score;
}student;
student s[20];
void student_enter(int n)
{
int i;
for(i=0;i<n;i++)
{
printf("please enter %d ",i+1);
printf("please enter no:");
scanf("%d",&s[i].no);
printf("please ente name:");
scanf("%s",&s[i].name);
printf("please enter score:");
scanf("%lf",&s[i].score);
}
printf("\n");
}
int main()
{
int n;
scanf("%d",&n);
student_enter(n);
}
为啥只能输入一次呀