#include<iostream>#include<stdexcept>usingnamespace std;intmain(){
string temp1,temp2;
cout<<"------"<<endl;while(cin>>temp1>>temp2){try{if(temp1 == temp2){
cout<<"匹配"<<endl;break;}else{throwruntime_error("Data must refer to same ISBN !");//异常检测}}catch(runtime_error err){//异常处理
cout<<err.what()<<"\nTry y or n?"<<endl;char str;
cin>>str;if( str =='n'){break;}}}
cout<<"结束over"<<endl;}