Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int a[101][101],n,m,i,j,x;
  5. int main()
  6. { cin>>n>>m;
  7. x=n*m;
  8. for(i=1;i<=n;i++)
  9. for(j=1;j<=m;j++)
  10. if(x!=0)
  11. {
  12. a[i][j]=x;
  13. x--;
  14. } for(i=1;i<=n;i++)
  15. {
  16. for(j=1;j<=m;j++)
  17. cout<<a[i][j]<<" ";
  18. cout<<endl;
  19. }
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement