Cpp_Primer 最浅显实例
#include<iostream>
using namespace std;
int main()
{
int x, y;
try
{
cin >> x;
cin >> y;
if (y == 0)
{
throw runtime_error("除数为0\n");
}
cout << x / y << endl;
}
catch (runtime_error& e)
{
cout << e.what();
}
}