Advertisement
elephantsarecool

toms 4

Oct 8th, 2017
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. char a[111][111];
  4. int main()
  5. {
  6.     int n,i,j;
  7.     char c;
  8.     cin>>n;
  9.     n+=2;
  10.     int m=n;
  11.     while(n--)
  12.     {
  13.        if(n%2==1) c='#'; else  c='x';
  14.        for(i=m-n;i<n;i++)
  15.            for(j=m-n;j<n;j++)
  16.             a[i][j]=c;
  17.     }
  18.     for(i=1;i<m;i++)
  19.     {
  20.         for(j=1;j<m;j++)
  21.             cout<<a[i][j];
  22.         cout<<endl;
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement