Back to list of problems
Power of Cryptography
113.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main(int argc, char *argv[]) { char buf1[1024]; char buf2[1024]; while(fgets(buf1, 1024, stdin)) { double a, b; if (!fgets(buf2, 1024, stdin)) { exit(1); } if (sscanf(buf1, "%lf", &a)!=1) { exit(2); } if (sscanf(buf2, "%lf", &b)!=1) { exit(3); } printf("%.0f\n", pow(b, 1/a)); } exit(0); }