Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a[21][21], n, p=2;
- cin>>n;
- for(int i=1; i<=n; i++)
- for(int j=1; j<=n; j++)
- {
- //if(p<=n*n) ???
- {
- while(p%3==0 && p%2==1)
- p++;
- a[i][j]=p;
- p++;
- //}
- }
- for(int i=1; i<=n; i++)
- {
- for(int j=1; j<=n; j++)
- cout<<a[i][j]<<" ";
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement