#include<iostream>
using namespace std;
//定义结构体
struct student {
string name;
int num;
int score;
};
struct teacher {
string name;
int age;
struct student stu;
};
int main()
{
//创建结构体
struct teacher s;
s.name = "zhang";
s.age = 88;
s.stu.name="li";
s.stu.num = 20221222;
s.stu.score = 100;
//遍历结构体
cout << "姓名: " << s.name
<< "\t年龄:" << s.age
<< "\t学生姓名:" << s.stu.name
<< "\t学生学号:" << s.stu.num
<< "\t学生成绩:" << s.stu.score<<endl;
return 0;
}