Skip to content

Instantly share code, notes, and snippets.

@catharsis96
Created June 25, 2017 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catharsis96/dd48292a2c7d0671de33fe2c4ac73781 to your computer and use it in GitHub Desktop.
Save catharsis96/dd48292a2c7d0671de33fe2c4ac73781 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <iomanip>
using namespace std;
const unsigned int DIM1 = 3;
const unsigned int DIM2 = 5;
int ary[DIM1][DIM2];
int main() {
for (int i = 0; i < DIM1; i++) {
for (int j = 0; j < DIM2; j++) {
ary[i][j] = (i + 1) * 10 + (j + 1);
}
}
for (int i = 0; i < DIM1; i++) {
for (int j = 0; j < DIM2; j++) {
cout << setw(4) << ary[i][j];
}
cout << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment