-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
75 lines (63 loc) · 1.86 KB
/
main.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <stdio.h>
#include <stdlib.h>
#include "BigNumber.h"
/**
* @brief Main function
*
* @return int
*/
int main(int argc, char** argv) {
// createAndSetBigNumber
printf("bn1 = createAndSetBigNumber: ");
int digits1[] = {1, 2, 3, 4, 5};
BigNumber *bn1 = createAndSetBigNumber(digits1, 5);
printBigNumber(bn1);
printf("\n");
// createBigNumber
printf("bn2 = createBigNumber: ");
BigNumber *bn2 = createBigNumber(5);
printBigNumber(bn2);
printf("\n");
// setBigNumber
printf("bn2 = setBigNumber: ");
int digits2[] = {1, 2, 3, 4, 5};
setBigNumber(bn2, digits2, 5);
printBigNumber(bn2);
printf("\n");
// addBigNumbers
printf("bn3 = addBigNumbers bn1, bn2: ");
BigNumber *bn3 = addBigNumbers(bn1, bn2);
printBigNumber(bn3);
printf("\n");
// copyBigNumber
printf("bn4 = copyBigNumber bn1: ");
BigNumber *bn4 = copyBigNumber(bn1);
printBigNumber(bn4);
printf("\n");
// destroyBigNumber
// printf("destroyBigNumber bn1: ");
// destroyBigNumber(bn1);
// printBigNumber(bn1);
// printf("\n");
// multiplyBigNumbers
printf("bn5 = multiplyBigNumbers bn2, bn3: ");
BigNumber *bn5 = multiplyBigNumbers(bn2, bn3);
printBigNumber(bn5);
printf("\n");
// minusBigNumbers
printf("bn6 = minusBigNumbers bn5, bn4: ");
BigNumber *bn6 = minusBigNumbers(bn5, bn4);
printBigNumber(bn6);
printf("\n");
// divideBigNumbers
printf("bn7 = divideBigNumbers bn5, bn6: ");
BigNumber *bn7 = divideBigNumbers(bn5, bn6);
printBigNumber(bn7);
printf("\n");
// remainderBigNumbers
printf("bn8 = remainderBigNumbers bn5, bn6: ");
BigNumber *bn8 = remainderBigNumbers(bn5, bn6);
printBigNumber(bn8);
printf("\n");
return 0;
}