1 条题解

  • 0
    @ 2025-4-7 21:29:27

    C++ :

    #include<iostream>
    #include<string>
    using namespace std;
    struct student{
    	string num;
    	string name;
    	int score[3];
    };
    student a[105];
    void input(student a[],int n)
    {
    	for (int i=0; i<n; i++)
    		cin>>a[i].num>>a[i].name>>a[i].score[0]>>a[i].score[1]>>a[i].score[2];
    }
    void output(student a[],int n)
    {
    	for (int i=0; i<n; i++)
    	{
    		cout<<a[i].num<<","<<a[i].name;
    		for (int j=0; j<3; j++) cout<<","<<a[i].score[j];
    		cout<<endl;
    	}
    }
    int main()
    {
    	int n;
    	cin>>n;
    	input(a,n);
    	output(a,n);
    	return 0;
    }
    
    • 1

    C语言程序设计教程(第三版)课后习题11.3

    信息

    ID
    1582
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    (无)
    递交数
    0
    已通过
    0
    上传者