JosepRivaille

P89336: Girant una llista de paraules (6)

Apr 9th, 2015
1,300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. void girar_llista(int& count) {
  6.     string x;
  7.     if (cin >> x) {
  8.         ++count;
  9.         girar_llista(count);
  10.         if (count <= 0) cout << x << endl;
  11.         count = count - 2;
  12.     }
  13. }
  14.  
  15. int main() {
  16.     int count = 0;
  17.     girar_llista(count);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment