首页 > 试题广场 >

程序的输出为( )

[单选题]
#include<bits/stdc++.h>
using namespace std;
int main(){
int n = 5;
vector<int>a;
set<int>b;
for(int i = 1; i <= n; ++i){
a.push_back(i);
b.insert(i);
}
for(int i = 1; i <= n; ++i){
a.push_back(i);
b.insert(i);
}
cout<<a.size()<<b.size()<<endl;
return 0;
}
程序的输出为( )
  • 105
  • 510
  • 1010
  • 55
set容器中相同元素只允许出现一次,若要插入相同元素应使用muliset
发表于 2019-09-17 17:06:07 回复(0)