#include<iostream>
#include<string>
using namespace std;
class Stu
{
private:
string name;
int number;
float result;
public:
void SetName(string n) { name = n; }
void SetNumber(int n) { number = n; }
void SetResult(float r) { result = r; }
string GetName() { return name; }
int GetNumber() { return number; }
float GetResult() { return result; }
Stu(string name, int number, float result) { this->name = name; this->number = number; this->result = result;}
};
int main()
{
Stu stu("李三利",20010010,80);//声明和初始化对象
stu.SetResult(100);
cout << stu.GetName() << " " << stu.GetNumber() << " " << stu.GetResult() << endl;
return 0;
}
|