📄 pr06028.cpp
字号:
////////////////////////////////////////
// File Name: pr06028.cpp
////////////////////////////////////////
#include <iostream>
// A Date structure.
struct Date
{
int month, day, year;
};
// An Employee structure.
struct Employee
{
int empno;
char name[35];
Date dates[3]; // hired, last review, terminated.
float salary;
};
Employee staff[] =
{
{ 1, "Bill", {{12,1,88},{2,24,92},{5,5,95}}, 35000 },
{ 1, "Paul", {{10,3,87},{5,17,94},{3,7,96}}, 25000 },
{ 1, "Jim", {{ 9,5,80},{9,11,96},{0,0, 0}}, 42000 },
{ 0 }
};
////////////////////////////////////////
// The main() function.
////////////////////////////////////////
int main()
{
Employee* pEmpl = staff;
while (pEmpl->empno != 0)
{
for (int i = 0; i < 3; i++)
{
Date& rd = pEmpl->dates[i];
std::cout << rd.month << '/'
<< rd.day << '/'
<< rd.year << " ";
}
std::cout << std::endl;
pEmpl++;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -