Created
September 24, 2017 17:36
-
-
Save invatainfo/475d39f6e1a6fef3925f38f62b65ce9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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