#include
#include
using namespace std;
class Teacher;//前向引用声明
class Student;//前向引用声明
class Teacher
{
private:
string name;
double wages;
public:
Teacher(string n,double w=0)
{
name=n;
wages=w;
}
friend void displayInfo(Student, Teacher);
};
class Student
{
private:
string name;
int score;
public:
Student(string n,int s)
{
name=n;
score=s;
}
friend void displayInfo(Student, Teacher);
}
void displayInfo(Student s, Teacher t){
cout<<“学生姓名:”<<s.name<<",学生成绩:"<<s.score<<endl;
cout<<“教师姓名:”<<t.name<<",教师工资:"<<t.wages<<endl;
}
int main() {
string s1,s2;
int d1;
double d2;
cin>>s1>>s2;
cin>>d1>>d2;
Student student(s1,d1);
Teacher teacher(s2,d2);
displayInfo(student, teacher);
return 0;
}