Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- using namespace std;
- int main(int argc, char** argv) {
- int a,x,k;
- cin>>a;
- for (int i =1 ; i<=a;i++)
- cout<<"#";
- cout<<endl;
- k=-1;
- for (int i=1;i<=a-2;i++){
- k++;
- cout<<"#";
- for (int j=0 ;(j<k);j++)
- cout<<" ";
- cout<<"#";
- for (x=1;x<=a-k-3;x++)
- cout<<" ";
- cout<<"#"<<endl;}
- for (int j=0;j<a;j++)
- cout<<"#";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement