fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. void showlist(list <int> g)
  4. {
  5. list <int> :: iterator it;
  6. for(it = g.begin(); it != g.end(); ++it)
  7. cout << '\t' << *it;
  8. cout << '\n';
  9. }
  10. int main() {
  11. // your code goes here
  12. list<int >s;
  13. s.push_front(2);
  14. s.push_front(3);
  15. s.push_front(2);
  16. s.push_front(2);
  17. showlist(s);
  18. return 0;
  19. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
	2	2	3	2