poj 2109 Power of Cryptography

p的范围…相当可怕,本来以为…要上高精度…然后二分…结果…
看代码吧…

double,一个神奇的类型。
(当然啦这题高精度和二分也能过…但是我这么懒…怎么会写呢…
(逃

#include <iostream>
#include <cmath>

int main(int argc, char *argv[]) {  
    double n, p;
    while(std::cin >> n >> p) {
        std::cout <<  pow(p, 1/n) << std::endl;
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/u013661468/article/details/72626593