Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- char a[111][111];
- int main()
- {
- int n,i,j;
- char c;
- cin>>n;
- n+=2;
- int m=n;
- while(n--)
- {
- if(n%2==1) c='#'; else c='x';
- for(i=m-n;i<n;i++)
- for(j=m-n;j<n;j++)
- a[i][j]=c;
- }
- for(i=1;i<m;i++)
- {
- for(j=1;j<m;j++)
- cout<<a[i][j];
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement