Pagini recente » Cod sursa (job #1806654) | Cod sursa (job #1707367) | Cod sursa (job #1883951) | Cod sursa (job #649061) | Cod sursa (job #2116702)
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
typedef unsigned int uint;
int main(void)
{
FILE *in = fopen("lgput.in", "r");
FILE *out = fopen("lgput.out", "w");
if(in != NULL && out != NULL)
{
uint x, n;
fscanf(in, "%u%*c%u%*c", &x, &n);
uint m = 1999999973, res = 1;
while(n)
{
if(n % 2 != 0)
{
res = ((res % m) * (x % m)) % m;
}
x = ((x % m) * (x % m)) % m;
n /= 2;
}
fprintf(out, "%u\n", res);
fclose(in);
fclose(out);
}
else
{
printf("file error\n");
}
return 0;
}