#include <iostream>
#include <vector>
#include <memory>
using namespace std;
shared_ptr<vector<int>> build_vec(){
int x;
vector<int> v1;
while(cin>>x)
v1.push_back(x);
shared_ptr<vector<int>> p = make_shared<vector<int>>(v1);
return p;
}
void print_vec(){
shared_ptr<vector<int>> ptr = build_vec();
for(auto &i:(*ptr))
cout<<i<<" ";
cout<<endl;
}
int main(int argc, char *argv[])
{
print_vec();
return 0;
}
c++ primer第五版练习12.7
最新推荐文章于 2022-09-04 00:24:32 发布