使用迭代器输出vector中的内容
来源:互联网 发布:预防网络诈骗标语 编辑:程序博客网 时间:2024/06/16 06:59
#include "iostream"
#include "string"
#include "cctype"
#include "vector"
using namespace std;
int main(){
vectorstr;
stringt;
//结束输入需要Ctrl+Z
while (cin>> t) {
str.push_back(t);
}
//第一遍循环迭代全体字符串
for (auto it= str.begin(); it != str.end(); ++it){
//第二遍循环迭代字符串里的字符
for (auto it2 = it->begin(); it2 != it->end(); ++it2){
//toupper()的参数是字符 而不是字符串
*it2 = toupper(*it2);
cout << *it2 << '\t';
}
}
cout<< endl;
return0;
}
#include "string"
#include "cctype"
#include "vector"
using namespace std;
int main(){
}
0 0
- 使用迭代器输出vector中的内容
- 使用迭代器输出vector中的内容
- 使用copy函数输出vector中的内容
- 使用copy算法输出map中的内容
- 使用STL copy 算法输出vector中的elements
- 使用命令将logcat中的内容输出到文本文件中
- 使用命令将logcat中的内容输出到文本文件中
- 使用命令将logcat中的内容输出到文本文件中
- C++中的vector使用
- 十进制输出AX中的内容
- 输出List中的实际内容
- 编写一个递归调用函数,输出vector对象的内容
- 使用foreach输出枚举内容
- C++中的vector使用范例
- C++中的vector使用范例
- C++中的vector使用范例
- C++中的vector使用范例
- C++中的vector使用范例
- 用jQuery和json实现级联菜单的效果
- python学习8:元组的使用
- 基带处理器和应用处理器的核间通信
- poj 3041 Asteroids 最大匹配
- .net学习路线
- 使用迭代器输出vector中的内容
- 输出表达式中的顺序点问题
- 一个异常抛出的例子
- Oracle查询并杀死锁死进程
- 插入排序与快速排序
- 大一时的BB
- Vundle:Vim Plugin 自動下載、安裝、更新與管理工具(Vim Bundle)
- creep
- 高考后的BB