Pagini recente » Cod sursa (job #2648122) | Cod sursa (job #1326144) | Cod sursa (job #2955772) | Cod sursa (job #2856978) | Cod sursa (job #1651167)
#include <stdio.h>
#include <stdlib.h>
int modular_pow(int baza,int exp,int mod){
int c;
if (mod == 1) return 0;
c = 1;
for (int e = 1; e<=exp; e++ ){
c = (c * baza) % mod;
}
return c;
}
int main(){
int x,y;
FILE *f,*g;
f=fopen("lgput.in", "r");
fscanf(f,"%d",&x);
fscanf(f,"%d",&y);
int rez = modular_pow(x,y,1999999973);
g=fopen("lgput.out","w");
fprintf(g,"%d",rez);
}