#include <iostream>
using namespace std;
struct Angajat {
char nume[50];
int varsta;
int salariu;
int an;
};
//Functie pentru citirea datelor de intrare
Angajat* citeste_date(int &n) {
cout << "\nNumar de angajati : ";
cin >> n;
Angajat* array_angajati = new Angajat[n];
cout << "\nIntroduceti date angajati (nume,varsta,salariu,an) : ";
for (int index = 0; index < n; index++) {
cout << "\nAngajat #" << index << " : ";
cin >> array_angajati[index].nume >> array_angajati[index].varsta >> array_angajati[index].salariu >> array_angajati[index].an;
}
return array_angajati;
}
void afiseaza_salariu_max(Angajat* arr,int n) {
int id_maxim = 0;
for (int index = 1; index < n; index++)
if (arr[index].salariu > arr[id_maxim].salariu)
id_maxim = index;
cout << "\n Angajatul cu salariul maxim este " << arr[id_maxim].nume;
}
int main() {
int n=0;
Angajat* arr = citeste_date(n);
afiseaza_salariu_max(arr, n);
}