nefu 117 素数分布 http://acm.nefu.edu.cn/test/problemshow.php?problem_id=117

#include<iostream>
#include<cmath>
using namespace std;

int main()
{
  int n;
  while(cin>>n)
  {
     int result;
     result=n-log10(n*log(10));

     cout<<result+1<<endl;
  }
}
利用素数定理  pi(x) 近似于 x/ln(x);


posted on 2013-07-08 19:14  814jingqi的ACM  阅读(112)  评论(0编辑  收藏  举报