Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct worker
- {
- char surname[50];
- int birthdate;
- int workdate;
- } *spisok;
- int main()
- {
- int n;
- cout << "Enter amount of workers: ";
- cin >> n;
- spisok = new worker[n];
- for (int i = 0; i < n; i++)
- {
- cout << "Enter the surname of worker: ";
- cin >> spisok[i].surname;
- cout << "Enter the birthdate of worker: ";
- cin >> spisok[i].birthdate;
- cout << "Enter the date of first work: ";
- cin >> spisok[i].workdate;
- cout << endl;
- }
- for (int i = 0; i < n; i++)
- {
- if (spisok[i].birthdate < 1980)
- {
- cout << "Worker that is not earlier than 1980: " << spisok[i].surname << endl;
- cout << "His birth date: " << spisok[i].birthdate << endl;
- cout << "His date of first work: " << spisok[i].workdate;
- cout << endl;
- }
- else cout << "> 1980";
- }
- delete[] spisok;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement