Advertisement
Guest User

c++

a guest
Feb 26th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(int argc, char** argv) {
  6.    
  7.     int a;
  8.     cin>>a;
  9.    
  10. cout<<endl;    cout<<endl;
  11.    
  12.     for(int i=1; i<=a; i++)
  13.         {for(int i=1; i<=a; i++)    
  14.             {cout<<"X";}
  15.                 cout<<endl;}                
  16.                
  17. cout<<endl;    cout<<endl;    
  18.    
  19.     for(int r=1; r<=a; r++)
  20.         {for(int x=1; x<=r; x++)
  21.             {cout<<"X";}
  22.                 cout<<endl;    }
  23.    
  24. cout<<endl;    cout<<endl;    
  25.  
  26.     for(int r=1; r<=a; r++)
  27.         {for(int x=1; x<=a-r; x++)
  28.             cout<<" ";
  29.                 for(int k=1; k<=r; k++)
  30.                     cout<<"X";
  31.                     cout<<endl;}
  32.        
  33. cout<<endl;    cout<<endl;    
  34.  
  35.     for(int k=1; k<=a; k++)    
  36.         cout<<"X";
  37.         cout<<endl;
  38.             for(int n=1;n<=a-2;n++){
  39.                 cout<<"X";
  40.             for(int j=1;j<=a-2;j++)
  41.                 cout<<" ";
  42.                 cout<<"X"<<endl;}
  43.             for(int l=1;l<=a;l++)    
  44.                 cout<<"X";
  45.    
  46.    
  47.     cout<<endl;    cout<<endl;    
  48.    
  49.    
  50.     for(int b=1;b<=a;b++)
  51.     {for(int c=1;c<=a-b;c++)
  52.             {cout<<" ";}
  53.                 for(int c=1;c<=b*2-1;c++)
  54.                         {cout <<"X";}
  55.                             cout<<endl;}
  56.    
  57.     for(int d=1;d<=2;d++)
  58.         {for(int d=1;d<=a-1;d++)
  59.             {cout <<" ";}
  60.                 cout<<"#"<<endl;}
  61.    
  62.    
  63.     return 0;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement