http://zhidao.baidu.com/link?url=USdzXySaOlweb_x6Y2PHDpdV2SKzhwGdEeIKIK7MogwAl5hmUvF9DCnLifnyo1emxvOAvT-qaH2bkALk66fr7L8jMWm05IlwOG7WsTD76sS
2014-04-03 23:59
提问者采纳
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include<iostream>
#include<string>
#include<vector>
using
namespace
std;
int
main()
{
vector<
char
> chVec;
chVec.push_back(
'a'
);
chVec.push_back(
'b'
);
chVec.push_back(
'c'
);
chVec.push_back(
'd'
);
chVec.push_back(
'e'
);
chVec.push_back(
'f'
);
string str =
""
;
//遍历vector
for
(vector<
char
>::iterator iter = chVec.begin(); iter != chVec.end(); ++iter)
{
str += *iter;
}
cout<<str<<endl;
return
0;
}
|
-
提问者评价