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);


原文地址:https://www.cnblogs.com/814jingqi/p/3217975.html