c++的几个小编程问题

来源:百度知道 编辑:UC知道 时间:2024/05/05 08:56:58
谁能帮我写一下程序,我是刚学,什么都不懂,尽量帮我写的简单点.
1.定义描述一个人出生日期的结构体类型变量,包括年,月和日.
2.定义描述关于c++的几个编程小问题通讯录的结构体类型变量,包括姓名,地址,电话号码和邮编.

#include <iostream>
#include <string>
using namespace std;

typedef struct
{
int year;
int month;
int day;
}BIR;
typedef struct
{
string name;
string address;
string num;
string postcode;
}People;

可以了吧?

#include <string.h>
using std::string;
struct birthdate{
string year;
string month;
string date;
};
struct phoneNode{
string name;
string address;
string phoneNumber;
string postNumber;
};