# include<iostream># include<vector># include<string># include<algorithm>using namespace std;void find1(vector<char>::iterator &pf, vector<char>::iterator &pb);int main(){ string str; vector<char> iv; getline(cin, str, '.'); cout<<str<<endl; iv.resize(1 + sizeof(str) / sizeof(char)); //iv.reserve(sizeof(str) / sizeof(char)); // resreve()只分配空间不初始化 copy(str.begin(), str.end(), iv.begin()); /*vector<char>::iterator pb = iv.end(); vector<char>::iterator pf = iv.begin(); for(pf; pf != pb; pf++) cout<<*pf; find1(iv.begin(), pb);*/ return 0;}
- 1 回答
- 0 关注
- 1428 浏览
添加回答
举报
0/150
提交
取消