-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path3.21_3.16.cpp
37 lines (35 loc) · 1.19 KB
/
3.21_3.16.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<iostream>
#include<vector>
#include<string>
int main()
{
std::vector<int> v1;
std::vector<int> v2(10);
std::vector<int> v3(10,42);
std::vector<int> v4{10};
std::vector<int> v5{10,42};
std::vector<std::string> v6{10};
std::vector<std::string> v7{10,"hi"};
for(std::vector<int>::const_iterator it = v1.cbegin(); it != v1.cend(); it++)
std::cout << *it << " ";
std::cout << std::endl;
for(std::vector<int>::const_iterator it = v2.cbegin(); it != v2.cend(); it++)
std::cout << *it << " ";
std::cout << std::endl;
for(std::vector<int>::const_iterator it = v3.cbegin(); it != v3.cend(); it++)
std::cout << *it << " ";
std::cout << std::endl;
for(std::vector<int>::const_iterator it = v4.cbegin(); it != v4.cend(); it++)
std::cout << *it << " ";
std::cout << std::endl;
for(std::vector<int>::const_iterator it = v5.cbegin(); it != v5.cend(); it++)
std::cout << *it << " ";
std::cout << std::endl;
for(std::vector<std::string>::const_iterator it = v6.cbegin(); it != v6.cend(); it++)
std::cout << *it << " ";
std::cout << std::endl;
for(std::vector<std::string>::const_iterator it = v7.cbegin(); it != v7.cend(); it++)
std::cout << *it << " ";
std::cout << std::endl;
return 0;
}