Advertisement
J00ker

(10-2)"T"

Oct 1st, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int n;
  6.  
  7. void Submultimi(int n)
  8. {
  9. int nr, i,j ,m, dif;
  10.  
  11. for(m = 1; m < n; m++)//elem
  12. {
  13. for(j = 1; j <= n-m+1; j++)//incep
  14. {
  15. for(dif = 0; dif < m;dif++)
  16. {
  17. cout << "{";
  18. i = j;
  19. cout << i << " ";i+=dif+1;
  20. for(nr = 2; nr <= m; nr++)//multimea cu incep si nr de elem
  21. {
  22. cout << i << " ";
  23. i++;
  24. }
  25. cout << " }\n";
  26. }
  27. }
  28. }
  29. }
  30.  
  31. int main()
  32. {
  33. Submultimi(5);
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement