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);
}
#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);
}
相关文章推荐
- Test if The Equation of $\LaTeX$ Style is Available
- You are using version 6.4.1 of the AdMob SDK which is non-compliant with the Google Play Ad Policy
- Can not find Storage Card of Mediaplay 11, and resolve of solution.
- JMeter命令行执行及问题解决 Error in NonGUIDriver java.lang.RuntimeException: Could not find the TestPlan class!
- Find the first non-repeating character from a stream of characters
- Find the two non-repeating elements in an array of repeating elements
- The notes of How We Test Software At Microsoft(5)
- HDU2227(Find the nondecreasing subsequences)
- find out the neighbour matrix of a mesh
- Platform Builder: Find the Source of a Data Abort; an Example
- Spring配置文件出现Cannot find the declaration of element “beans”的问题
- HDOJ 题目1595 find the longest of the shortest(枚举,最短路记录路径)
- Find the k-th minimal element of an unsorted array
- 解决文件无法上传的问题,错误信息:System.IO.DirectoryNotFoundException: Could not find a part of the path.
- Citrix Ready Solution of the Year(2011) Finalists announced
- Spring启动异常: cvc-elt.1: Cannot find the declaration of element 'beans'
- One of the MulticastTest
- DirectoryNotFoundException: Could not find a part of the path "……"
- IPERF Test for measuring the throughput/speed of a WLAN client.
- windows下python 安装igraph库报错 Cannot find the C core of igraph on this system using pkg-config.的解决