#include <iostream>
using namespace std;
int main(void)
{ vector<string> svec;
svec.push_back("I");
svec.push_back("LOVE");
svec.push_back("C++");
for (vector<string>::size_type ind = 0;ind != svec.size(); ++ind) {
cout << svec[ind]; // print current element
// if not the last element, print a space to separate from the next one
if (ind + 1 != svec.size())
cout << " ";
}
return 0;
}
for 对vector类型进行循环输出
最新推荐文章于 2025-01-01 21:40:38 发布
