void main(){try{if (rand()%2==0) throw out_of_range("err1");if (rand()%2==0) throw domain_error("err2");}catch (...){printLine("exception");}printLine("ok");}
static void main(){try{if (rand()%2==0) throw out_of_range("err1");if (rand()%2==0) throw domain_error("err2");}catch (out_of_range &){printLine("out_of_range");}catch (domain_error &){printLine("domain_error");return;}printLine("ok");}