Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- int main()
- {int N,i,j,k;
- cin>>N;
- for (i = 1; i <= N; i++)
- {
- for (j = 1; j <= N - i; j++)
- cout << " ";
- cout<<"*";
- for ( j = 1; j <= 2*i - 2; j++)
- cout << " ";
- if (i!=1)cout<<"*";
- cout << endl;
- }
- for (i = N - 1; i >= 1; i--)
- { for (j = 1; j <= N - i; j++)
- cout << " ";
- cout<<"*";
- for (j = 1; j <= 2 * i - 2; j++)
- cout << " ";
- if (i!=1)cout<<"*";
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement