类似于素数打表。

 #include <cstdio>
#include <cstring>
#include <algorithm>
#define maxn 1000100
using namespace std; int f[maxn]; void inti()
{
int num=;
for(int i=; i<maxn; i++)
{
if(f[i]==)
{
num++;
for(int j=i; j<maxn; j+=i)
{
f[j]=num;
}
}
}
} int main()
{
int n;
inti();
while(scanf("%d",&n)!=EOF)
{
printf("%d\n",f[n]);
}
return ;
}

最新文章

  1. web.xml文件加载顺序
  2. Finalize()、Dispose()、SafeHandle、GC
  3. python install_opener用法
  4. char(10)和VARCHAR(10)主要的区别是什么?
  5. [Stanford 2011] Views 知识点
  6. UVa 1595 (水题) Symmetry
  7. CSS3 transition 属性 过渡效果
  8. hibernate 连接数据库时报错
  9. 使用AlarmManager进行定时任务处理
  10. react-native 环境配置及hello world
  11. ElasticSearch(7)-排序
  12. Java反射机制剖析(一)-定义和API
  13. jssdk防覆盖
  14. 从零开始学安全(三十三)●Ununtu16 LMAP 环境搭建
  15. Cordova Error: cmd: Command failed with exit code ENOENT
  16. Linux 上pcntl安装步骤
  17. python --- 13 内置函数
  18. 在string资源中添加变量
  19. 【WP8.1】系统控件的bug及修复方案
  20. Sticker.js生成图片或者页面元素“速干贴”效果

热门文章

  1. 【转】Linux下tar.xz结尾的文件的解压方法
  2. 美国易安信公司 EMC
  3. JS-Date日期内置对象
  4. writev/readv
  5. [原创]安卓使用Termux做渗透测试(演示sqlmap安装,并附上一个神器)
  6. React Native 初识
  7. Java虚拟机之垃圾回收详解一
  8. PHP设计模式笔记六:数据对象映射模式 -- Rango韩老师 http://www.imooc.com/learn/236
  9. java.util.Map.Entry接口
  10. myPagination5.0 分页简单实例