int vectors2() {
std::string mystring;
std::ifstream myfile;
myfile.open(“input.txt”);
int matrix;
if (myfile.is_open()) {
int a = 0, b = 0;
while (myfile.good()) {
myfile >> mystring;
std::cout << mystring << std::endl;
matrix[a][b] = stoi(mystring);
if (b == 2) { a++; b = 0; }
else { b++; }
}
}
std::cout << “matrix” << std::endl;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
std::cout << matrix[i][j] << “ “;
}
std::cout << “” << std::endl;
}
std::cout << “new matrix” << std::endl;
for (int i = 2; i >= 0; i—) {
for (int j = 0; j < 3; j++) {
std::cout << matrix[i][j] << “ “;
}
std::cout << “” << std::endl;
}
std::ofstream myoutputfile;
myoutputfile.open(“ouput.txt”);
if (myoutputfile.is_open()) {
for (int i = 2; i >= 0; i—) {
for (int j = 0; j < 3; j++) {
myoutputfile << matrix[i][j] << “ “;
}
myoutputfile << “” << std::endl;
}
myoutputfile.close();
}
return 2;
}