-->
当前位置:首页 > 题库

单选题:If you enter 1 0, what is the output of the following code?

Luz5年前 (2021-05-10)题库1040
If you enter 1 0, what is the output of the following code? @[D](2)
```C++
#include "iostream"
using namespace std;

int main()

{
// Read two integers


cout << "Enter two integers: ";

int number1, number2;

cin >> number1 >> number2;

try
{
if (number2 == 0)
throw number1;

cout << number1 << " / " << number2 << " is "
<< (number1 / number2) << endl;

cout << "C" << endl;
}
catch (int e)
{
cout << "A" ;
}

cout << "B" << endl;

return 0;
}
```


A. A
B. B
C. C
D. AB




A.A
B.B
C.C
D.AB


答案:D