正在加载图片...
例:输入职工的编号、姓名、性别、年龄、出生日期和工资, 然后输出。 #include <iostream. h #include <iomanip.h> #include <string. h> struct date ∥定义出生日期结构体类型 short year short month: short day struct employee ∥定义职工信息结构体类型 Ichar num 5: char name] char sex: int age struct date birthday; float salary;3; C++程序设计课件设计制作:徐龙琴 17C++程序设计课件 设计制作:徐龙琴 17 例:输入职工的编号、姓名、性别、年龄、出生日期和工资, 然后输出。 #include <iostream.h> #include <iomanip.h> #include <string.h> struct date //定义出生日期结构体类型 {short year; short month; short day;}; struct employee //定义职工信息结构体类型 {char num[5]; char name[20]; char sex; int age; struct date birthday; float salary;};
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有