概述:求n的几次方等于p
思路:出题人的本意可能是想考察大数类,结果弄巧成拙,用Double型就能完全表示计算结果。
感想:无。
#include<iostream>
#include<fstream>
#include <cmath>
using namespace std;
int main()
{
//ifstream cin("aaa.txt");
double n;
double s;
while (cin >> n >> s)
{
cout << pow(s,1/n) << endl;
}
return 0;
}