#include<iostream>
#include<string>
using namespace std;
class STU
{
public:
void setnum()
{
cin>>m_number;
}
void setnum(string s)
{
m_number=s;
}
string getnum()
{
return m_number;
}
void setname();
string getname();
void printinfo();
private:
string m_number;
string m_name;
};
void STU::setname()
{
cin>>m_name;
}
?
string STU::getname()
{
return m_name;
}?
void STU::printinfo()
{
cout<<"number:"<<m_number<<"? "<<"name:"<<m_name<<endl;
}
int main()
{
STU st;
st.setnum();
st.setname();
st.printinfo();
return 0;
}? ?
#include<iostream>
#include<string>
using namespace std;
class STU
{
public:
? ? void printinfo();
private:
void setnum()
{
cin>>m_number;
}
void setnum(string s)
{
m_number=s;
}
string getnum()
{
return m_number;
}
void setname();
string getname();
private:
string m_number;
string m_name;
};
void STU::setname()
{
cin>>m_name;
}
?
string STU::getname()
{
return m_name;
}?
void STU::printinfo()
{
setnum();
setname();
cout<<"number:"<<getnum()<<"? "<<"name:"<<getname()<<endl;
}
int main()
{
STU st;
st.printinfo();
return 0;
}? ?