From 7da20b0f1402396ddf720eaf4f0585fa9e324b27 Mon Sep 17 00:00:00 2001 From: Subly Date: Mon, 22 Aug 2016 13:29:22 +0800 Subject: [PATCH] Update ex5_25.cpp --- ch05/ex5_25.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ch05/ex5_25.cpp b/ch05/ex5_25.cpp index 9b11e56a..27606dda 100644 --- a/ch05/ex5_25.cpp +++ b/ch05/ex5_25.cpp @@ -16,8 +16,12 @@ int main(void) cout << "Input two integers: "; } catch (runtime_error err) { - cout << err.what() << "\n" - << "Try again.\nInput two integers: "; + cout << err.what() ; + cout << "\nTry Again? Enter y or n:" << endl; + char c; + cin >> c; + if (!cin || c == 'n') + break; } }