⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 person.cpp

📁 我大一时候做的C++课程设计
💻 CPP
字号:
#include"person.h"
#include<iostream.h>
#include<string.h>
#include<stdlib.h>
#include <iomanip.h>

int person::count=0;

person::person()
{
	strcpy(name,"NULL");
	birthday.year=9999;birthday.month=99;birthday.day=99;
	sex='N';
	strcpy(num,"NULL");
	strcpy(nationality,"NULL");
	strcpy(education,"NULL");
	strcpy(address,"NULL");
	strcpy(telNum,"NULL");
	strcpy(Email,"NULL");
	count++;
	
}
person::~person()	{}

void person::print()
{
	cout<<setw(10)<<name<<setw(8)<<birthday.year<<setw(3)<<birthday.month<<setw(3)<<birthday.day
		<<setw(3)<<sex<<setw(8)<<num<<setw(6)<<nationality
		<<setw(8)<<education<<setw(11) <<address<<setw(8)<<telNum<<setw(10)<<Email<<endl;
}

/*b person::get_birth()
{
	return birthday;
}*/

int person::get_birth()
{
	return birthday.year*10000+birthday.month*100+birthday.day;
}

void person::set_inf(char *na,int y,int m,int d,char s, char *nu,char *nation,char *ed,char *add,char *tel, char *e)
{
	strcpy(name,na);
	birthday.year=y;birthday.month=m;birthday.day=d;
	sex=s;
	strcpy(num,nu);
	strcpy(nationality,nation);
	strcpy(education,ed);
	strcpy(address,add);
	strcpy(telNum,tel);
	strcpy(Email,e);

}

int person::get_ct()	{return count;}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -