Требуется вывести элементы стека, проект не хочет собираться, исходный код:
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <random>
#include <stack>
#include <queue>
using namespace std;
void print_stack(stack<int>& s) {
vector<int> tmp;
while (!s.empty()) {
tmp.push_back(s.top());
s.pop();
}
for (int i = 0; i < tmp.size(); i++) {
cout << tmp[i] << "\n";
}
}
typedef long long ll;
int main()
{
stack<int> a;
a.push(5);
a.push(4);
a.push(3);
print_stack(a);
return 0;
}
