题目大意: K ^ N = P, 给N 和 P, 求K。数据规模 :1<=n<= 200, 1<=p<10^101 and there exists an integer k, 1<=k<=109 。
#include<iostream>
#include<cmath>
using namespace std;
int main(int argc,char *argv[])
{
int n;
double k,p;
while (cin>>n>>p)
{
k=pow(p,1.0/n);
cout<<k<<endl;
}
return 0;
}
本文介绍了一个简单的C++程序来解决给定N和P的情况下寻找K的问题,即求解K^N=P中的K值。该程序使用了标准输入输出,并通过pow函数实现了幂次方根的计算。
1007

被折叠的 条评论
为什么被折叠?



