-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVpractice.cpp
More file actions
77 lines (43 loc) · 1018 Bytes
/
Copy pathVpractice.cpp
File metadata and controls
77 lines (43 loc) · 1018 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <vector>
#include <iostream>
using namespace std;
int main()
{
vector<double> a;
vector<double>::const_iterator i;
a.push_back(1);
a.push_back(2);
a.push_back(3);
a.push_back(4);
a.push_back(5);
for(i=a.begin(); i!=a.end(); i++)
{
cout<<(*i)<<endl;
}
return 0;
}
/*
int main(){
/*int arr[]={4,3,2,1,6,7};
int target = 5;
int size = sizeof(arr)/sizeof(int);
cout<<"size1:"<<size<<endl;
arrCheck(arr, size, target);
*/
/* typedef vector<int> int_vec;
int size = 10;
vector<int> MyVector(size);
for (int i=0;i< size ; i++)
MyVector[i]=i*2;
cout<<MyVector[7]<<endl;
int_vec V2;
V2.push_back(12);
for (int i=0;i< size*2 ; i++)
V2.push_back(i);
V2.reserve(100);
cout<<V2[5]<<endl;
cout<<"Cap:"<<V2.capacity()<<endl;
cout<<"size:"<<V2.size()<<endl;
return 0;
}
*/