12345678910111213141516171819202122232425262728293031323334353637383940414243
#include <iostream> using namespace std; int Input(int One[2][3]) { for(int row = 0; row < 3; row++) { for(int column = 0; column < 4; column++) { cout << "Input element [" << row << "][" << column << "]: "; cin >> One[row][column]; } } } int Print(int One[2][3]) { for(int row = 0; row < 3; row++) { for(int column = 0; column < 4; column++) { cout << One[row][column] << " "; } cout << endl; } } int main() { int One[2][3]; Input(One); Print(One); cin.get(); cin.ignore(); return 0; }
1234567
for(int row = 0; row < 2; row++) { for(int column = 0; column < 3; column++) { // some code } }
1 2 3 4 5 6
1 2 3 4 5 6 7 8 9 10 11 12