zoj 2818 Root of the Problem
2011-12-27 22:00
330 查看
#include "iostream" #include "cmath" using namespace std; int main() { double B, N; while (cin >> B >> N && B && N) { int A = 0; A = pow(double (B), double (1/N)); if (B - pow(double (A), double(N)) < pow (double(A+1), double(N)) - B) cout << A << endl; else cout << A + 1 << endl; } }
相关文章推荐
- POJ 3100 & ZOJ 2818 & HDU 2740 Root of the Problem(数学)
- POJ 3100 & ZOJ 2818 & HDU 2740 Root of the Problem(数学)
- poj 3100 && zoj 2818 ( Root of the Problem ) (睡前一水)
- zoj2818 Root of the Problem 简单数学 开方
- zoj 2818 || poj 3100 Root of the Problem(水! = =)
- zoj 2818 Root of the Problem
- zoj 2818 Root of the Problem(数学思维题)
- Root of the Problem-3100
- ZOJ Problem Set - 2338 The Towers of Hanoi Revisited DFS+预处理
- hdu 2740 Root of the Problem (水)
- hdu 2740 Root of the Problem (水)
- a的n次幂 —— POJ 3100 Root of the Problem
- ZOJ Problem Set - 1090 The Circumference of the Circle
- POJ 3100 Root of the Problem(我的水题之路——取A^N最接近B的A)
- POJ 3100 Root of the Problem 可能会
- POJ 3100 Root of the Problem(简单题)
- D - Root of the Problem思维题
- Root of the Problem(求a,a^n接近b)
- POJ 3100:Root of the Problem
- poj 3100 Root of the Problem