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