int main() {std::ifstream file("N4.txt");if (!file.is_open()) {std::cout << "File not found.";return 1;}
}
int main() {
int num1, num2, num3;std::ifstream file("N4.txt");
if (!file.is_open()) {
std::cout << "File not found.";
return 1;
}
file >> num1 >> num2 >> num3;
file.close();
std::cout << "Numbers read from file: " << num1 << " " << num2 << " " << num3 << std::endl;
double geometric_mean = sqrt(num1 * num2 * num3);
std::cout << "Geometric mean: " << geometric_mean << std::endl;
std::ofstream outFile("N44.txt");
if (!outFile.is_open()) {
std::cout << "Output file could not be opened.";
return 1;
}
outFile << "Numbers read from file: " << num1 << " " << num2 << " " << num3 << std::endl;
outFile << "Geometric mean: " << geometric_mean << std::endl;
outFile.close();
return 0;
}