Advertisement
Guest User

Untitled

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