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