#include <iostream>
using namespace std;
/*void row(int &p,int &q)//引用
{
int t;
t=p;
p=q;
q=t;
}*/
/*struct ab
{
string name;
// int &age;
};
void add(int a,int b)
{
cout << a+b<< endl;
}
void add(float a,float b)
{
cout << a+b << endl;
}
void add(string a, string b)
{
cout << a+b <<endl;
}*/
struct stu
{
string xingbie;
int nl;
void fun();
void set_get(string a,int b)
{
name=a;
chengji=b;
}
private:
string name;
int chengji;
};
void stu::fun()
{
cout << name << endl;
cout << chengji << endl;
cout << nl << endl;
cout << xingbie << endl;
}
int main()
{
/*int a=100,b=200;
int &re=a;
int &rd=b;
row(re,rd);
cout <<"&a"<< &a << endl;
cout <<"&re" << &re << endl;
cout <<"&rd" << &rd << endl;
cout <<"re=" << re <<endl;
cout <<"a="<<a<<endl;
cout <<"b="<<b<<endl;*/
/*int t;
int a[5]={1,4,3,2,5};
int (&re)[5]=a;
int b=10;
int *p=&b;
int &rd=p;*/
/* int x=18;
struct ab a={"zhangsan",x};
struct ab a;
a.name="zhangsan";
cout << a.name << endl;*/
/*
int *p=new int ;
cout <<"p="<< p<< endl;
int *q=new int [5]{1,2,3,4,5};
for(int i=0;i<5;i++)
{
cout << q[i] << endl;
}*/
/*int a=1;
int b=2;
float c=1;
float d=2;
string e="hello";
string f="world";
add(a,b);
add(c,d);
add(e,f);*/
struct stu s1;
s1.set_get("zhangsan",100);
s1.nl=18;
s1.xingbie="男";
s1.fun();
return 0;
}