#include #include int func3(int input) { std::cout << "func3 start" << std::endl; if (input < 10) throw std::runtime_error("Exception in func3"); else std::cout << "Num: " << input << std::endl; std::cout << "func3 end" << std::endl; return 0; } int func2(int input) { std::cout << "func2" << std::endl; func3(input); return 0; } int func1(int input) { std::cout << "func1" << std::endl; func2(input); return 0; } int main(int argc, char* argv[]) { int input = std::stoi(argv[1]); try { std::cout << "main" << std::endl; func1(input); } catch (const std::exception& e) { std::cerr << "Exception caught: " << e.what() << std::endl; } return 0; }