// BASIC.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
using namespace std;
struct employee
{
int id;
char name[20];
char sex[2];
};
int main()
{
employee emp[5];
for (size_t i = 1; i <= 3; i++)
{
cout << "输入emp[" << i << "]数据" << "\n";
cout << "id:";
cin >> emp[i].id;
cout << "name:";
cin >> emp[i].name;
cout << "sex:";
cin >> emp[i].sex;
}
for (size_t i = 1; i <= 3; i++)
{
cout << "输出emp[" << i << "]数据" << "\n";
cout << "id=" << emp[i].id << "\n";
cout << "name=" << emp[i].name << "\n";
cout << "sex=" << emp[i].sex << "\n";
}
}