3.4.1
来源:互联网 发布:java udp编程和 tcp 编辑:程序博客网 时间:2024/06/08 13:56
3.21
#include<iostream>#include<string>#include<vector>using namespace std;void print(const vector<int> & vec) { cout << vec.size() << endl; for (auto a = vec.begin(); a != vec.end(); ++a) { cout << *a << " "; } cout << endl;}void print(const vector<string> & vec) { cout << vec.size() << endl; for (auto a = vec.begin(); a != vec.end(); ++a) { cout << *a << " "; } cout << endl;}int main() { vector<int> v1; // size:0, no values. vector<int> v2(10); // size:10, value:0 vector<int> v3(10, 42); // size:10, value:42 vector<int> v4{ 10 }; // size:1, value:10 vector<int> v5{ 10, 42 }; // size:2, value:10, 42 vector<string> v6{ 10 }; // size:10, value:"" vector<string> v7{ 10, "hi" }; // size:10, value:"hi"\ print(v1); print(v2); print(v3); print(v4); print(v5); print(v6); print(v7); return 0;}
3.22
#include<iostream>#include<string>#include<vector>using namespace std;int main() { string buffer; vector<string> vec; while (cin >> buffer) { vec.push_back(buffer); } for (auto &a : vec) { for (auto &b : a) { b= toupper(b); } cout << a << " "; } cout << endl; return 0;}
3.23
#include<vector>#include<iostream>using namespace std;int main() { vector<int> vec{ 0,10,20,30,40,50,60,70,80,90 }; for (auto i = vec.begin(); i != vec.end(); ++i) { *i *= 2; } for (auto a : vec) { cout << a << " "; } return 0;}
0 0
- 3.4.1
- eclipse 3.4.1汉化
- USACO 3.4.1
- usaco fence4 3.4.1
- C - Fractal(3.4.1)
- C - Fractal(3.4.1)
- C - Fractal(3.4.1)
- - Fractal(3.4.1)
- pycharm 3.4.1 安装
- pycharm 3.4.1 安装
- 3.4.1 - Numeric Types
- RxSwift(3.4.1)
- RxSwift(3.4.1)
- 3.3.3/3.4.1
- 3.4.1性能优化
- dinamica changelog 3.4.3 (2014上半年) 3.4.1-3.4.3
- arm-linux-gcc-3.4.1
- 学习 3.4.1约瑟夫问题
- 期末总结
- There is no getter for property named 'id' in 'class java.lang.Integer
- Ext4使用总结(十一) Grid的单元格的背景色和字体的处理
- 10实践项目2.2
- 第35篇 IOS-WebRTC BUG处理(三)之问题图片导入及本地运行两个nodejs
- 3.4.1
- 【转】2016年最值得关注的十个微信公众号
- Spring3:AOP精讲
- spring依赖问题2 (很麻烦的问题)
- 嵌入式的优缺点
- python第三方库安装
- 培训快毕业了,有好些问题留下,方便日后查找
- 安装Git
- SQL Server中,给字段设置约束,设置默认值注意事项