第28503题 单选题
分析以下C++代码段,程序运行后的输出依次是?

给定如下C++代码片段:

#include <iostream>
using namespace std;
int main() {
    int a = 5;
    double b = 2.5;
    cout << a / b << endl;
    cout << 5 / 2 << endl;
    cout << 5.0 / 2 << endl;
    return 0;
}
A

2.0, 2, 2.5

B

2, 2, 2.5

C

2.5, 2, 2.5

D

2, 2.5, 2

程序运行统计
暂无判题统计
提交0次 正确率0.00%
答案解析