现在的位置: 首页 > 综合 > 正文

POJ 2109 k^n=p,已知n,p,求K

2013年03月12日 ⁄ 综合 ⁄ 共 232字 ⁄ 字号 评论关闭

题目大意: 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;
}

 

抱歉!评论已关闭.