您的位置:首页 > 其它

Numeric test, find the solution of non-polynomial equation, play

2007-02-04 00:36 399 查看
#include <iostream>

#include <math.h>

using namespace std;

class Utility

{

public:

int static Left(int n)

{

return 8*n*n;

}

int static Right(int n)

{

return (int)64*n*log((double)n)/log(2.0);

}

void static PrintFrame(int n)

{

cout<<"n = "<<n<<" Left = "<<Left(n)<<" Right = "<<Right(n)<<endl;

}

};

int main()

{

const int MAX_SEEK = 1000;

const int SATISFY_BIG = 3;

int BigEvidence = 0;

for(int n=1;n<MAX_SEEK;n++)

{

if(Utility::Left(n)>Utility::Right(n))

{

Utility::PrintFrame(n);

BigEvidence++;

if(BigEvidence>=SATISFY_BIG)

{

break;

}

}

}

Utility::PrintFrame(43);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: