-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path21.cpp
42 lines (37 loc) · 849 Bytes
/
21.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
38
39
40
41
42
#include <iostream>
#include <string.h>
#include <vector>
using std::cout;
using std::endl;
using std::vector;
using std::string;
void check_And_Print(vector<int> v) {
for (auto it = v.begin(); it != v.end(); ++it) {
cout << *it << endl;
}
}
void check_And_Print(vector<string> v) {
for (auto it = v.begin(); it != v.end(); ++it) {
cout << *it << 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"};
vector<string> v8(10);
vector<string> v9(10, "hi");
check_And_Print(v1);
check_And_Print(v2);
check_And_Print(v3);
check_And_Print(v4);
check_And_Print(v5);
check_And_Print(v6);
check_And_Print(v7);
check_And_Print(v8);
check_And_Print(v9);
}