Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sa se afis. toate sirurile s. crescatoare care
- // incep cu 7 si ultimul element sa fie max 11
- #include <iostream>
- using namespace std;
- int x[20];
- void date_in();
- void back(int);
- void date_out(int);
- int main()
- {
- x[1] = 7;
- back(2);
- return 0;
- }
- void back(int i)
- {
- for(int j = x[i-1] + 1; j <= 11; j++)
- {
- x[i] = j;
- date_out(i);
- back(i + 1);
- }
- }
- void date_out(int k)
- {
- for(int j = 1; j <= k; j++)
- cout << x[j] << " ";
- cout << "\n";
- }
Add Comment
Please, Sign In to add comment