-
Notifications
You must be signed in to change notification settings - Fork 0
/
vecmain.c
53 lines (44 loc) · 970 Bytes
/
vecmain.c
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
#include "dynamic_array.h"
#include <stdio.h>
int main(void) {
int n;
int val;
int i;
int x;
Vector vec;
Vector wec;
vec = vecini();
/* printf("input n of values: "); */
scanf("%d", &n);
/* printf("input values: "); */
while (n--) {
scanf("%d", &val);
vecapd(vec, val);
}
/* printf("input down\n"); */
vecprt(vec);
/* printf("input value: "); */
scanf("%d", &x);
/* printf("input index: "); */
scanf("%d", &i);
vecins(vec, i, x);
vecprt(vec);
/* printf("input delete index: "); */
scanf("%d", &i);
/* printf("deleted elem is: %d\n",vecdel(vec, i)); */
vecprt(vec);
vecinv(vec);
/* printf("\tinversed: \t"); */
vecprt(vec);
wec = vecini();
/* printf("input n of values: "); */
scanf("%d", &n);
/* printf("input values: "); */
while (n--) {
scanf("%d", &val);
vecapd(wec, val);
}
/* printf("input down\n"); */
/* printf("merged array is: \n"); */
vecprt(vecmeg(vec, wec));
}