-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3.16.cpp
More file actions
61 lines (52 loc) · 1008 Bytes
/
3.16.cpp
File metadata and controls
61 lines (52 loc) · 1008 Bytes
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <iostream>
#include <vector>
#include <string>
using std::vector;
using std::string;
using std::cout;
using std::endl;
int main() {
vector<int> v1;
vector<int> v2(10);
vector<int> v3(10, 42);
vector<int> v4{10};
vector<int> v5{10, 42};
vector<string> v6{10};
vector<string> v7{10, "hi"};
cout << "v1: " << v1.size() << endl;
for (auto i : v1) {
cout << i << " ";
}
cout << endl;
cout << "v2: " << v2.size() << endl;
for (auto i : v2) {
cout << i << " ";
}
cout << endl;
cout << "v3: " << v3.size() << endl;
for (auto i : v3) {
cout << i << " ";
}
cout << endl;
cout << "v4: " << v4.size() << endl;
for (auto i : v4) {
cout << i << " ";
}
cout << endl;
cout << "v5: " << v5.size() << endl;
for (auto i : v5) {
cout << i << " ";
}
cout << endl;
cout << "v6: " << v6.size() << endl;
for (auto s : v6) {
cout << s << " ";
}
cout << endl;
cout << "v7: " << v7.size() << endl;
for (auto s : v7) {
cout << s << " ";
}
cout << endl;
return 0;
}