Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <locale>
- #include <stdlib.h>
- #include <time.h>
- #include <iomanip>
- using namespace std;
- struct firm
- {
- char surname[20];
- char position[25];
- int year_of_birth;
- int experience;
- int salary;
- };
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int a;
- firm *str;
- do
- {
- cout << "Кол.во сотрудников фирмы ";
- cin >> a;
- } while (a <= 0);
- str = new firm[a];
- cout << "Сотрудники фирмы " << endl;
- cout << endl;
- for (int i = 0; i < a; i++)
- {
- cout << "Фамилия ";
- cin >> str[i].surname;
- cout << "Должность ";
- cin >> str[i].position;
- cout << "Год рождения ";
- cin >> str[i].year_of_birth;
- cout << "Стаж ";
- cin >> str[i].experience;
- cout << "Оклад ";
- cin >> str[i].salary;
- }
- cout << "+---------+-----------+--------------+------+-------+" << endl;
- cout << "|Фамилия |Должность |Год рождения |Стаж |Оклад |" << endl;
- cout << "+---------+-----------+--------------+------+-------+" << endl;
- for (int i = 0; i < a; i++)
- {
- cout << "|" << setw(9) << str[i].surname << "|" << setw(11) << str[i].position << "|" << setw(14) << str[i].year_of_birth << "|" << setw(6) << str[i].experience << "|" << setw(7) << str[i].salary << "|" << endl;
- cout << "+---------+-----------+--------------+------+-------+" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement