Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. main()
  8. {
  9.     int n{2};
  10.     for (int i = 0; i<5; i++){
  11.         for(int j = 0; j<n; j++){
  12.             cout << "*";
  13.         }
  14.         cout << endl;
  15.         if(n==11){
  16.             return 0;
  17.         }
  18.         if(n>5){
  19.             n+=4;
  20.         }
  21.         else if(n>2){
  22.             n+=2;
  23.         }
  24.         else if(n==2){
  25.             n++;
  26.         }
  27.     }
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement