Advertisement
SageTheWizard

Untitled

Oct 10th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int N;
  8. int count = 0;
  9. cout << "Input N: ";
  10. cin >> N;
  11.  
  12. for (int i = 1; i <= N; i++)
  13. for (int j = 1; j <= i; j++)
  14. for (int k = 1; k <= j; k++)
  15. {
  16. count++;
  17. cout << count << endl;
  18. }
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement