Light


私信TA

用户名:uq_66472224170

访问量:1547

签 名:

等  级
排  名 2461
经  验 2210
参赛次数 0
文章发表 6
年  龄 20
在职情况 学生
学  校 南通大学
专  业 计算机科学与技术

  自我简介:

解题思路:

注意事项:

参考代码:

#include<iostream>

using namespace std;

struct student

{

char id[20];

char name[20];

int score[3];

};

student stu[100];

void input(int n)

{

for(int i=0;i<n;i++)

{

cin>>stu[i].id>>stu[i].name;

for(int j=0;j<3;j++)

    cin>>stu[i].score[j];

}

}

void print(int n)

{

for(int i=0;i<n;i++)

{

cout<<stu[i].id<<","<<stu[i].name;

for(int j=0;j<3;j++)

    cout<<","<<stu[i].score[j];

cout<<endl;

}

}

int main()

{

int n;

cin>>n;

input(n);

print(n);

return 0;

}


 

0.0分

1 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区