1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
int arrayOfNum[5][5] = {
{34,21,32,41,25},
{14,42,43,14,31},
{54,45,52,42,23},
{33,15,51,31,35},
{21,52,33,13,23}};
ofstream arrayFile;
arrayFile.open("arrays.txt");
if (arrayFile.is_open()) {
cout << "File opened successfully..." << endl;
}
for (int i = 0; i <= 4; i++) {
arrayFile << endl;
for (int j = 0; j <= 4; j++) {
arrayFile << arrayOfNum[j][i] << ' ';
}
}
|