Код: Выделить всё
#include
#include
#include
#include
#include
int main(void)
{
FILE * fr, * fw;
char input[255];
char output[255];
unsigned long int size = 0;
unsigned long int rt;
const char * power = "power";
const char * plus= "plus";
printf("Enter filename : ");
fgets(input, 255, stdin);
input[strcspn(input, "\r\n")] = 0;
fr = fopen(input, "rb");
if (fr == NULL)
{
printf("The file can't be open\n'");
}
fseek(fr, 0L, SEEK_END);
size = ftell(fr);
fseek(fr, 0L, SEEK_SET);
if (size == -1)
{
printf("Size of file can't be matched\n'");
}
if ( size > SIZE_MAX)
{
printf("Size is greater than acceptable\n");
}
unsigned char * buf = NULL;
buf = malloc((size_t)size);
if(buf == NULL)
{
printf("Buffer failure\n");
}
fread(buf, size, 1, fr);
if (ferror(fr))
{
printf("File can't be opened\n'");
fclose(fr);
}
fclose(fr);
mpz_t data;
mpz_init(data);
mpz_import(data, size, 1, (size_t)1u, 0, 0, buf);
if (size15)&&(size100)&&(size1000)&&(size10000)&&(size100000)&&(size1000000)&&(size10000000)&&(size
Подробнее здесь: [url]https://stackoverflow.com/questions/79760276/the-remainder-of-rounded-integer-root-by-gnu-gmp-is-very-huge[/url]