Pagini recente » Cod sursa (job #1623169) | Cod sursa (job #2013393) | Cod sursa (job #1669737) | Cod sursa (job #2840571) | Cod sursa (job #3227527)
#include <stdio.h>
float exp_log_rec(float x, int n) {
if(n < 0) {
return exp_log_rec(1.0 / x, -n);
}
if(n == 0) {
return 1;
}
if(n % 2 == 0) {
return exp_log_rec(x*x, n/2);
}
if(n % 2 == 1) {
return x * exp_log_rec(x*x, n/2);
}
return 0;
}
int main() {
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
float nr = 0;
int exp = 0;
scanf("%f%d", &nr, &exp);
printf("%d", (int)exp_log_rec(nr, exp) % 1999999973);
return 0;
}