Thursday, July 29, 2010

ACM-113 Power of Cryptography with C


#include <stdio.h>
#include <math.h>


int main(int argc, char* argv[])
{
 double n,p;
 double k;
 
 while (scanf("%lf %lf", &n, &p) == 2) 
 {
  k = exp(log(p)/n);
  printf("%.0lf\n", k);
 }
 
 return 0;
}

No comments: