Created
May 24, 2019 07:51
-
-
Save pro100skm/2252bd35891fe2fac575e7981197b658 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "my_lab.h" | |
#include <string.h> | |
int main() | |
{ | |
FILE* file; | |
FILE* results; | |
fopen_s(&file, "c:/test/test.txt", "r"); | |
if (file == NULL) | |
{ | |
printf_s("Error1"); | |
return 1; | |
} | |
fopen_s(&results, "c:/test/results.txt", "r"); | |
char s[40], f[40], j[40]; | |
int lenTemp = 0; | |
//read first num | |
HugeInt a; | |
printf_s("%s", "Before read"); | |
a.read(file); | |
//read second number | |
HugeInt b; | |
b.read(file); | |
b.setSign(1); | |
//read result | |
HugeInt result; | |
result.read(results); | |
HugeInt c; | |
c = a + b; | |
for (int i = 0; i < 40; i++) | |
{ | |
printf_s("%d", c.num[i]); | |
} | |
printf_s("\n"); | |
if (c == result) { | |
printf_s("%s", "OK"); | |
} | |
//printf_s("%d/10", res); | |
// printf_s("< %d\n", b < a); | |
// printf_s("> %d\n", b > a); | |
// printf_s("== %d\n", b == a); | |
// printf_s("!= %d\n", b != a); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment