// Code derived from Stroustrup's PPP2 book// § 5.10 Pre- and post-conditions// -and beginning on p 165#include<iostream>#include<stdexcept>usingstd::cerr;usingstd::cout;usingstd::exception;usingstd::runtime_error;// void error(const char* s) { throw runtime_error(s); }/*// the arguments are positive and a < b < cint my_complicated_function(int a, int b, int c){ if (! (0 < a && a < b && b < c)) // ! means “not” and && means “and” error("bad arguments for mcf"); // . . . return 1; // stub}*/intmy_complicated_function(inta,intb,intc){// . . .return1;// stub}intmain()try{intx=my_complicated_function(1,2,"horsefeathers");cout<<x<<'\n';}catch(exception&e){cerr<<"error: "<<e.what()<<'\n';// keep_window_open();return1;}catch(...){cerr<<"Oops: unknown exception!\n";// keep_window_open();return2;}