#include <iostream>
#include <stack>
using namespace std;
int main()
{
stack<string> s1;
stack<string> s2;
stack<string> s3;
s1.push("Sam Williams 60");
s1.push("John Phoenix 85");
s1.push("Simon Johnson 75");
s1.push("Sarah Khosa 81");
s1.push("Mat Jackson 38");
s1.push("Nick Roberts 26");
s1.push("Isaac Wayne 74");
s1.push("Anna Mishima 34");
s1.push("Daniel Rose 64");
s1.push("Aaron Black 83");
s1.push("Jack Mohamed 27");
s1.push("Kathrine Bruckner 42");
while (!s1.empty()) {
cout << ' ' << s1.top()<<endl;
s1.pop();
}
while (!s1.empty()) {
s2.push(s1.top());
s1.pop();
}
while (!s1.empty()) {
cout << ' ' << s2.top()<<endl;
s2.pop();
}
while (!s2.empty()) {
s3.push(s2.top());
s2.pop();
}
while (!s1.empty()) {
cout << ' ' << s3.top()<<endl;
s3.pop();
}
return 0;
}
Comments
Leave a comment