Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n,m,a[1005][1005];
- int main()
- {
- int x=2;
- cin>>m>>n;
- for(int i=1;i<=m;i++)
- for(int j=1;j<=n;j++)
- {
- if(x%5==0)
- x+=2;
- a[i][j]=x;
- x+=2;
- }
- for(int i=1;i<=m;i++)
- {
- for(int j=1;j<=n;j++)
- cout<<a[i][j]<<" ";
- cout<<"\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment