#include
#include
using namespace std;
int main()
{
vector ivec;
char name[20];
cout << "请输入字符串" << endl;
while (cin >> name)
ivec.push_back(name);
for (vector::iterator it = ivec.begin(); it != ivec.end(); it ++)
cout << *it << endl;
cout << ivec.size() << endl;
cout << endl;
return 0;
}
运行结果为:
请输入字符串
ii jj kk
~Z
3
请按任意键继续......
更多 0 分享到: