#include<iostream>
using namespace std;
class Student{
private:
string strName;
unsigned long nIndex;
int nScore;
public:
Student()//析构函数
{
strName="Unknown";nIndex=0;nScore=0;
cout<<"Constructed with an unknow student."<<endl;
}
Student(string strNameNew,unsigned long nIndexNew,int nScoreNew)//析构函数
{
strName=strNameNew;nIndex=nIndexNew;nScore=nScoreNew;
cout<<"String constructor has been called."<<endl;
}
Student(char* pStrName,unsigned long nIndexNew,int nScoreNew)//析构函数
{
strName=pStrName;nIndex=nIndexNew;nScore=nScoreNew;
cout<<"String constructor has been called."<<endl;
}
string GetName(){return strName;}
unsigned long GetIndex(){return nIndex;}
int GetScore(){return nScore;}
void SetName(string strNameNew) {strName=strNameNew;}
void SetIndex(unsigned long nIndexNew) {nIndex=nIndexNew;}
void SetScore(int nScoreNew) {nScore=nScoreNew;}
};
int main()
{
Student student1;
Student student2("Marry",1,100);
string strName="Susun";
Student student3(strName,2,90);
return 0;
}