//______________________________________________________________________________________________________
#include<iostream>
#include<string>
#include<stdlib>
using namespace std;
//____________________________________________________________________________________________________
struct student {
string id; //学号
string xing_ming; //姓名
string xing_bie; //性别
string ji_guan; //籍贯
string ja_ting_zhu_zhi;//家庭住址
string ja_ting_dian_hua;//家庭电话
void chu_chi_hau(); //初始化
void cha_kang();//查看
void se_zhi(string,string,string,string,string,string);
//设置
};
//______________________________________________________________________________________________________
void student::chu_chi_hau() {
id="10001";
xing_ming="张三";
xing_bie="男";
ji_guan="广东阳春";
ja_ting_dian_hua="0662-7311065";
ja_ting_zhu_zhi="广东省阳春市河口";
}
//______________________________________________________________________________________________________
void student::cha_kang() {
cout<<"学号:"<<id<<"\n"
<<"姓名:"<<xing_ming<<"\n"
<<"性别:"<<xing_bie<<"\n"
<<"籍贯:"<<ji_guan<<"\n"
<<"家庭电话:"<<ja_ting_dian_hua<<"\n"
<<"家底住址:"<<ja_ting_zhu_zhi<<"\n"
<<endl;
}
//______________________________________________________________________________________________________
void student::se_zhi(string _id,
string _xing_ming,
string _xing_bie,
string _ji_guan,
string _ja_ting_dian_hua,
string _ja_ting_zhu_zhi) {
_id=id;
xing_ming=_xing_ming;
xing_bie=_xing_bie;
ji_guan=_ji_guan;
ja_ting_dian_hua=_ja_ting_dian_hua;
ja_ting_zhu_zhi=_ja_ting_zhu_zhi;
}
//______________________________________________________________________________________________________
int main(int argc, char* argv[])
{
student me;
me.chu_chi_hau() ;
me.cha_kang();
me.se_zhi("10003","李四","女","广东阳春","0662-7310062","广东省阳春市");
me.cha_kang() ;
system("pause");
return 0;
}
//______________________________________________________________________________________________________