#include <iostream>
using namespace std;
#include"time_user.h"
class student
{
public:
void display();
public:
int num;
string name;
char sex;
};
void student::display()
{
cout << "num: " << num << endl;
cout << "name: " << name << endl;
cout << "sex: " << sex << endl;
}
int main()
{
student stl1;
stl1.name = "gyg";
stl1.num = 1001;
stl1.sex = 'm';
stl1.display();
}
标签:cout,5.6,int,sex,stl1,student,display From: https://www.cnblogs.com/zjm921/p/17378619.html