Advertisement
a53

GenMat27

a53
Jan 11th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int A[21][21];
  4.  
  5. int main()
  6. {
  7. int n,m;
  8. cin>>m>>n;
  9. int k=2;
  10. for(int i=1;i<=m;++i)
  11. for(int j=1;j<=n;++j)
  12. if(k%5!=0)
  13. A[i][j]=k,k+=2;
  14. else
  15. A[i][j]=k+2,k+=4;
  16. for(int i=1;i<=m;++i)
  17. {
  18. for(int j=1;j<=n;++j)
  19. cout<<A[i][j]<<' ';
  20. cout<<'\n';
  21. }
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement