#include
#include
using namespace std;
class Person
{
private:
string name;//姓名,如果不需要该信息,请自行删去
char sex;//性别
int age;//年龄
public:
Person(string strn,char chs,int inta )
{
name=strn;
sex=chs,
age=inta;
}
Person(){}
void Action() const{
cout<}
void Print() const {
cout<<"name: "<cout<<"sex: "< cout<<"age: "< Action();//调用另一个成员函数Action()
}
};
int main()
{
Person a("Mr. Zhang",'M',19);
a.Print();//显示信息
return 0;
}