解题思路:

注意事项:

参考代码:#include<stdio.h>
struct Student{
char number[10];
char name[10];
int score[3];
};
int main()
{
    int n;
    scanf("%d",&n);
    struct Student students[n];
    void input(struct Student students[],int n);
    void print(struct Student students[],int n);
    
    input(students,n);
    print(students,n);
    return 0;
}

void input(struct Student students[],int n){
    for(int i=0;i<n;i++){
        scanf("%s %s %d %d %d",students[i].number,students[i].name,
    &students[i].score[0],&students[i].score[1],&students[i].score[2]);
    }
}
void print(struct Student students[],int n){
    for(int i=0;i<n;i++){
        printf("%s,%s,%d,%d,%d\n",students[i].number,students[i].name,
    students[i].score[0],students[i].score[1],students[i].score[2]);
    }
}


 

0.0分

0 人评分

  评论区

  • «
  • »