Advertisement
H34VENT

Nested for

Dec 16th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main (){
  5.     int i, j;
  6.    
  7.     for (int i=1; i<=7; i++){
  8.         for (int j=i; j>0; --j){
  9.             cout << j;
  10.         }
  11.         cout << "\n";
  12.     }
  13. }
  14.  
  15. /*
  16. 1
  17. 21
  18. 321
  19. 4321
  20. 54321
  21. 654321
  22. 7654321
  23. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement