#include<iostream>
#include<vector>
using namespace std;
int main() {
    vector<string> v2;
    string new1;
    while (cin >> new1) {
        v2.push_back(new1);  //push_back()将内容添加至v2的末尾
        for (string& i : v2)//for循环这里用于下面的输出,不能直接输出v2,因为v2是一个容器
            cout << i << endl;
    }
    return 0;

}
最后修改:2022 年 12 月 05 日
如果觉得我的文章对你有用,请随意赞赏