刚开始看着道题时,感觉不用高精度好像就没法做,想了半天然后果断去看依然博客(这样确实不好),发现又用到了double(这个可以放“+” “-” 300多位的家伙!!!)
#include <iostream> #include <cmath> using namespace std; int main() { double p, q; while(cin >> p >> q) { cout << pow(q, 1.0/p) << endl; } return 0; }
刚开始看着道题时,感觉不用高精度好像就没法做,想了半天然后果断去看依然博客(这样确实不好),发现又用到了double(这个可以放“+” “-” 300多位的家伙!!!)
#include <iostream> #include <cmath> using namespace std; int main() { double p, q; while(cin >> p >> q) { cout << pow(q, 1.0/p) << endl; } return 0; }