Skip to content

Instantly share code, notes, and snippets.

@pro100skm
Created May 24, 2019 07:51
Show Gist options
  • Save pro100skm/2252bd35891fe2fac575e7981197b658 to your computer and use it in GitHub Desktop.
Save pro100skm/2252bd35891fe2fac575e7981197b658 to your computer and use it in GitHub Desktop.
#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