Guest User

Untitled

a guest
Feb 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. // Sa se afis. toate sirurile s. crescatoare care
  2. // incep cu 7 si ultimul element sa fie max 11
  3.  
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. int x[20];
  8.  
  9. void date_in();
  10. void back(int);
  11. void date_out(int);
  12.  
  13. int main()
  14. {
  15.     x[1]  = 7;
  16.     back(2);
  17.     return 0;
  18. }
  19.  
  20.  
  21. void back(int i)
  22. {
  23.     for(int j = x[i-1] + 1; j <= 11; j++)
  24.     {
  25.         x[i] = j;
  26.         date_out(i);
  27.         back(i + 1);
  28.     }
  29. }
  30.  
  31. void date_out(int k)
  32. {
  33.    
  34.     for(int j = 1; j <= k; j++)
  35.         cout << x[j] << " ";
  36.     cout << "\n";
  37. }
Add Comment
Please, Sign In to add comment