如果输入 10 0,会输出( )。
#include<iostream>
using namespace std;
double Division(int a, int b)
{
if (b == 0)
throw "Division by zero condition!";
else
return ((double)a / (double)b);
}
void func()
{
int len, time;
cin >> len >> time;
cout << Division(len, time) << endl;
}
int main()
{
try {
func();
}
catch (const char* errmsg)
{
cout << errmsg << endl;
}
catch (const int errmsg)
{
cout << errmsg << endl;
}
return 0;
}