-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
72 lines (41 loc) · 861 Bytes
/
main.cpp
File metadata and controls
72 lines (41 loc) · 861 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
#include <iostream>
#include <cassert>
#include <string>
#include "MyVector.h"
#include "Generales.h"
using namespace std;
using namespace UTEC;
int main() {
TipoEntero n = 20;
MyVector v1(n);
v1.fill();
v1.push_back(23);
v1.print();
v1.insert(1,22);
v1.print();
v1.print();
(v1+v1).print();
/*
assert(v1.size() == 0);
v1.push_back(10);
v1.push_back(20);
v1.push_back(30);
assert(v1.size() == 3);
MyVector v2;
MyVector v3 = v1 + v2;
assert(v3.size() == 3));
int total =0;
for(int i=0;1<v1.size();++i)
total+=v1[1];
assert(total ==60);
std::string resultado;
try{
v1.insert(10,10);
}
catch (const exception& e){
resultado = e.what();
}
assert(resultado == "Fuera de limite");
*/
return 0;
}