#include<iostream>
using namespace std;
#include<string>
class Person{
public:
//写姓名(设置姓名)
void setName(string name)
{
m_name=name;
}
//读姓名:获取姓名
string getName()
{
return m_name;
}//int,string这些必须有返回值
//读取年龄
int getage(){
m_age=0;//初始化为零岁
return m_age;
}
void setlover(string lover){
m_lover=lover;
}
private:
string m_name;//姓名:可读可写
string m_lover;//爱人:只写
int m_age;//年龄:只读
};
int main(){
Person p1;
p1.setName("taysteee");
p1.setlover("fiona");
cout<<p1.getName()<<endl;
cout<<"年龄为:"<<p1.getage()<<endl;
return 0;
}