编程语言
首页 > 编程语言> > c++primer练习12.6

c++primer练习12.6

作者:互联网

 1 auto getter() {
 2     return new vector<int>();
 3 }
 4 auto setter(vector<int>* vec) {
 5     int x;
 6     while (cin >> x)
 7         vec->push_back(x);
 8     return vec;
 9 }
10 auto read(vector<int>* vec) {
11     for (auto fuck : *vec)
12         cout << fuck << ends;
13 }
14 int main() {
15     
16     auto vec=getter();
17     vec=setter(vec);
18     read(vec);
19     delete vec;
20 }

 

标签:return,cout,int,auto,c++,vector,12.6,primer,vec
来源: https://www.cnblogs.com/otakus/p/12956070.html