Witam! jak w temacie.
#include <iostream>
#include <math.h>
#include <vector>
#include <stack>
using namespace std;
int main()
{
int ile;
struct student {
char imie[20];
char nazwisko[20];
int wiek;
};
stack <student> osoba;
student a;
cout << "ile studentow chcesz dodac? " << endl;
cin >> ile;
for (int i = 0; i < ile; i++) {
cin >> a.imie >> a.nazwisko >> a.wiek;
osoba.push(a);
}
while (!osoba.empty()) {
// w tym coucie jest blad, nie chce mi wypisac 3ech gornych elementow stosu
cout <<osoba.top();
osoba.pop();
}
system("pause");
return 0;
}