#GESP2419. [GESP]L4-202406-Q2419-S
[GESP]L4-202406-Q2419-S
下面的程序中,如果输入 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;
}
{{ select(1) }}
- Division by zero condition!
- 0
- 10
- 100
相关
在下列比赛中: