1. 首页
  2. 编程语言
  3. C++ 
  4. 北邮足球俱乐部第一版

北邮足球俱乐部第一版

上传者: 2018-12-28 12:22:30上传 ZIP文件 620.22KB 热度 32次
绝对准确无误,刚验收完 #include #include #include #include #include using namespace std; class Player//球员类 { public: //外部接口,可以使用 Player(string NewN, int NewAge, int NewAbli, int NewS, int NewV, int NewG, int NewY)//名字为字符串,其余为数字:年龄,能力,薪水,转会费,进球数,年限 { name = NewN; age = NewAge; ability = NewAbli; salary = NewS; value = NewV; goals = NewG; years = NewY; } string GetName() { return name; } //读取私有成员,得到私有成员的值 int GetAge() { return age; } int Ge tAbility() { return ability; } int GetSalary() { return salary; } int GetValue() { return value; } int GetGoals() { return goals; } int GetYears() { return years; } void Modifyname(string nam) { name = nam; }//修改数据,修改单项值 void ModifyAge(int n) { age = n; } void ModifyAbility(int n) { ability = n; } void ModifySalary(int n) { salary = n; } void ModifyValue(int n) { value = n; } void ModifyGoals(int n) { goals = n; } void ModifyYears(int n) { years = n; } private: string name; //姓名 int age, ability, salary, value, goals, years; //年龄,能力,年薪,转会费,进球数,服役年限 }; tAbility() { return ability; } int GetSalary() { return salary; } int GetValue() { return value; } int GetGoals() { return goals; } int GetYears() { return years; } void Modifyname(string nam) { name = nam; }//修改数据,修改单项值 void ModifyAge(int n) { age = n; } void ModifyAbility(int n) { ability = n; } void ModifySalary(int n) { salary = n; } void ModifyValue(int n) { value = n; } void ModifyGoals(int n) { goals = n; } void ModifyYears(int n) { years = n; } private: string name; //姓名 int age, ability, salary, value, goals, years; //年龄,能力,年薪,转会费,进球数,服役年限 };
用户评论