Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n;
- void Submultimi(int n)
- {
- int nr, i,j ,m, dif;
- for(m = 1; m < n; m++)//elem
- {
- for(j = 1; j <= n-m+1; j++)//incep
- {
- for(dif = 0; dif < m;dif++)
- {
- cout << "{";
- i = j;
- cout << i << " ";i+=dif+1;
- for(nr = 2; nr <= m; nr++)//multimea cu incep si nr de elem
- {
- cout << i << " ";
- i++;
- }
- cout << " }\n";
- }
- }
- }
- }
- int main()
- {
- Submultimi(5);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement