题库 软件开发 题目列表 阅读下面 C++ 代码,输出结果为() #include <i...
单选题
阅读下面 C++ 代码,输出结果为()
#include <iostream>
using namespace std;

class base1 {
private: int a, b;
public:
    base1(int i) : b(i + 1), a(b) {}
    base1():b(0), a(b) {}
    int get_a() { 
        return a; 
    }
    int get_b() { 
        return b; 
    }
};
int main() {
    base1 obj1(11);
    cout << obj1.get_a() << " " << obj1.get_b() << endl;
    return 0;
}
A.

12 12

B.

随机数 12

C.

随机数 随机数

D.

12 随机数

题目信息
校招真题
-
正确率
0
评论
5
点击