编写一个函数print,打印一个学生的成绩数组

编写一个函数print,打印一个学生的成绩数组,该数组中有5个学生的数据,每个学生的数据包括num(学号)、name(姓名)、score[3](3门课的成绩)。用主函数输入这些数据,用print函数输出这些数据。


#include "stdafx.h"
#include
#include
using namespace std;


struct Student
{
int num;
string name;
int score[3];
};


void print(Student stu[5])
{
for(int i=0;i<5;i++)
{
cout<cout<cout<}
}


int _tmain(int argc, _TCHAR* argv[])
{
Student student[5];             //定义结构体数组
for(int j=0;j<5;j++)
{
cin>>student[j].num;
cin>>student[j].name;
for(int k=0;k<3;k++)
{
cin>>student[j].score[k];
}
}
print(student);
return 0;
}

你可能感兴趣的:(编写一个函数print,打印一个学生的成绩数组)