第30264题 单选题
以下C++代码执行后的输出结果是?
#include <iostream>
#include <vector>
using namespace std;
int main() {
    vector<int> v;
    v.reserve(10);
    for(int i=0; i<5; i++) {
        v.push_back(i+1);
    }
    v.erase(v.begin()+2);
    v.insert(v.begin()+1, 10);
    cout << v.size() << " " << v.capacity() << endl;
    return 0;
}
A

5 10

B

5 5

C

6 10

D

4 10

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