1 solutions

  • 0
    @ 2025-11-5 15:58:06

    C :

    #include<stdio.h>
    #define max_len 10
    #define stu_num 30
    #define course_num 6
    typedef struct student 
    {
    	long num;
    	char name[max_len];
    	float score[course_num];	
    }STU;
    void ReadScore(STU stu[],int n,int m)
    {
    	int i,j;
    	char ch;
    	printf("Input student's ID,name and score:\n");
    	for(i=0;i<n;i++)
    	{
    		scanf("%ld",&stu[i].num);
    		scanf("%s",stu[i].name);
    		for(j=0;j<m;j++)
    		{
    			scanf("%f",&stu[i].score[j]);
    		}
    	}
    }
    int main()
    {
    int n=0,m=0;
    STU stu[stu_num];
    scanf("%d",&n);
    scanf("%d",&m);
    ReadScore(stu,n,m);
    return 0;
    }
    
    
    • 1

    【设计型】第12章:结构体和共同体 实验题 学生成绩管理系统(1)

    Information

    ID
    17386
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By