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