Advertisement
tanasaradu

Untitled

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