#include <iostream>
#include <string>
using namespace std;
#include <string>
//1.老师结构体
//2.学生结构体
struct student
{
string sname;
int score;
};
struct teacher
{
string tname;
student stuarr[5];
};
void a(struct teacher teaarr[], int len)
{
string nameseed = "ABCDE";
for (int i = 0; i < len; i++)
{
teaarr[i].tname = "teacher_";
teaarr[i].tname += nameseed[i];
for (int j = 0; j < 5; j++)
{
teaarr[i].stuarr[j].sname = "student_";
teaarr[i].stuarr[j].sname += nameseed[j];
}
}
}
int main()
{
struct teacher teaarr[3];
int len = sizeof(teaarr) / sizeof(teaarr[0]);
a(teaarr, len);
system("pause");
return 0;
}
|