Skip to content

Instantly share code, notes, and snippets.

@invatainfo
Created September 24, 2017 17:36
Show Gist options
  • Save invatainfo/475d39f6e1a6fef3925f38f62b65ce9b to your computer and use it in GitHub Desktop.
Save invatainfo/475d39f6e1a6fef3925f38f62b65ce9b to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main() {
int n,m,a[24][24],i,j,k = 1;
cin >> n >> m;
for (j = 0; j < m; j++)
for (i = 0; i < n; i++)
a[i][j] = k++;
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++)
cout<< a[i][j] << " ";
cout<<'\n';
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment