for 对vector类型进行循环输出
2017-04-19 00:07
295 查看
#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; }
相关文章推荐
- c:forTokens标签循环输出-对带有相同符合格式内容进行分割输出
- 不用循环,对数组每个元素进行处理,类型转换和输出
- 使用for...in进行对象循环
- 对输入的数进行相应次数的循环输出;如果输入的数为12,则输出1122,如果是123则输出111222333
- 编写程序定义一个vector 对象,其每个元素都是指向string 类型的指针,读 取该vector 对象,输出每个string 的内容及其相应的长度。
- JS中利用jquery 获得class 进行判断 for循环和each两种方法
- PHP for 循环如何实现实时输出
- 面试题-一个for循环输出一个棱形
- SSIS【For 循环容器】(循环输出数值)
- 转 C#多线程及控制线程数量,对for循环输出效率
- 09-使用for循环输出空心菱形(循环)
- 对Sql进行类似For循环处理
- Java高新技术【1】 (静态导入-可变参数-增强for循环-基本数据类型的自动拆箱与装箱)
- 一个for循环输出二维数组
- 转 C#多线程及控制线程数量,对for循环输出效率
- 不要把无符号类型的数作为 for 递减循环体内的循环变量
- struts2中实现for语句循环输出树前的不同字数空格
- 用JAVA 的for循环输出 菱形
- 在开发过程中,数据的输入和输出全部用string类型进行交互,是否会更好一些?
- 黑马程序员-------(高新技术)静态导入、可变参数、增强for循环、基本数据类型的自动拆箱与装箱