poj2109

本来想二分,后来发现一个函数就解决了。

 

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;

int main()
{
	double p, n;

	//freopen("D:\\t.txt", "r", stdin);
	while (cin >> n >> p)
		printf("%.0f\n", pow(p, 1 / n));
	return 0;
}
posted @ 2011-02-01 14:24  金海峰  阅读(556)  评论(0编辑  收藏  举报