Person类实现

上传:suffer_80764 浏览: 10 推荐: 0 文件:cpp 大小:2.68KB 上传时间:2023-03-11 03:38:06 版权申诉
#include "Person.h"

Person::Person(string n, int a, string g): name(n), age(a), gender(g){}

string Person::getName() const{
    return name;
}

int Person::getAge() const{
    return age;
}

string Person::getGender() const{
    return gender;
}

void Person::setName(string n){
    name = n;
}

void Person::setAge(int a){
    age = a;
}

void Person::setGender(string g){
    gender = g;
}
上传资源
用户评论