Advertisement
Dizzy3113

Untitled

Jan 4th, 2020
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a[21][21], n, p=2;
  8. cin>>n;
  9. for(int i=1; i<=n; i++)
  10. for(int j=1; j<=n; j++)
  11. {
  12. //if(p<=n*n) ???
  13. {
  14. while(p%3==0 && p%2==1)
  15. p++;
  16. a[i][j]=p;
  17. p++;
  18. //}
  19.  
  20. }
  21.  
  22. for(int i=1; i<=n; i++)
  23. {
  24. for(int j=1; j<=n; j++)
  25. cout<<a[i][j]<<" ";
  26. cout<<endl;
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement