首页 > 其他 > 详细

迭代器

时间:2017-12-14 14:28:16      阅读:159      评论:0      收藏:0      [点我收藏+]

1.基本操作

#include<iostream>
#include<string>
#include<fstream>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<sstream>
#include<algorithm>
using namespace std;
//

int main(int argc,char *argv[]){
    string line;
    vector<string>v;
    while (getline(cin, line)){
        v.push_back(line);
        for (auto i = v.begin(); i != v.end() && !i->empty(); i++){
            for (auto &c : *i)
                c = toupper(c);
            cout << *i<< endl;
        }
    }
    system("pause");
    return 0;
}

 

迭代器

原文:http://www.cnblogs.com/bananaa/p/8037462.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!