tanasaradu

Untitled

Nov 23rd, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int n,m,a[1005][1005];
  4. int main()
  5. {
  6. int x=2;
  7. cin>>m>>n;
  8. for(int i=1;i<=m;i++)
  9. for(int j=1;j<=n;j++)
  10. {
  11. if(x%5==0)
  12. x+=2;
  13. a[i][j]=x;
  14. x+=2;
  15. }
  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