1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #include <iostream>
- #if(0)
- struct Student
- {
- std::string name;
- int age;
- int score;
- };
- struct Teacher
- {
- int id;
- std::string name;
- int age;
- struct Student stu;
- };
- int main()
- {
-
-
- Teacher t;
- t.id = 10000;
- t.name = "老王";
- t.age = 50;
- t.stu.name = "小王";
- t.stu.age = 20;
- t.stu.score = 60;
- std::cout << "老师姓名:" << t.name << "老师编号:" << t.id << "老师年龄:" << t.age << "老师辅导的学生姓名:" << t.stu.name << "学生的年龄:" << t.stu.age << "学生的成绩:" << t.stu.score << std::endl;
- system("pause");
- return 0;
- }
- #endif
|