首页 > 代码库 > 练习5.6.3节

练习5.6.3节

#include<iostream>#include<stdexcept>using namespace std;int main(){    int a,b;    label: cin>>a>>b;    try    {    if(b==0)throw runtime_error("重输");    cout<<a/b<<endl;    }    catch(runtime_error err)    {    cout<<err.what()        <<"重输"<<endl;    goto label;    }    return 0;}

  

练习5.6.3节