-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstl.cpp
More file actions
34 lines (33 loc) · 667 Bytes
/
Copy pathstl.cpp
File metadata and controls
34 lines (33 loc) · 667 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
#include<iostream>
#include<vector>
using namespace std;
void printvec(vector<int> v){
cout<<"Size"<<v.size()<<endl;
for(int i=0;i<v.size();i++){
cout<<v[i]<<" ";
}
cout<<endl;
}
//first
// int main(){
// vector<int> v; /* satrt at sizeis 0*/
// int n;
// cin>>n;
// for(int i=0;i<n;i++){
// int x;
// cin>>x;
// printvec(v);
// v.push_back(x); /*elemnt insert at back in */
// }
// printvec(v);
// }
//second
int main(){
vector<int> v;
v.push_back(5);
v.push_back(54);
v.push_back(45);
printvec(v);
v.pop_back(); //pop the data back side
printvec(v);
}