1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include <iostream> using namespace std; int main () { cin.exceptions(ios::failbit); int foo; try { cin >> foo; } catch (const exception& e) { cerr << "Exception occured." << e.what() << '\n'; return 0; } cout << "Should not output this"; } |
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4gKCkKewogICAgY2luLmV4Y2VwdGlvbnMoaW9zOjpmYWlsYml0KTsKICAgIGludCBmb287CiAgICB0cnkKICAgIHsKICAgICAgICBjaW4gPj4gZm9vOwogICAgfQogICAgY2F0Y2ggKGNvbnN0IGV4Y2VwdGlvbiYgZSkKICAgIHsKICAgICAgICBjZXJyIDw8ICJFeGNlcHRpb24gb2NjdXJlZC4iIDw8IGUud2hhdCgpIDw8ICdcbic7CiAgICAgICAgcmV0dXJuIDA7CiAgICB9CiAgICBjb3V0IDw8ICJTaG91bGQgbm90IG91dHB1dCB0aGlzIjsKfSAg
-
upload with new input
-
result: Success time: 0.01s memory: 2812 kB returned value: 0
test
Exception occured.basic_ios::clear


