h
来源:互联网 发布:mac win8开始菜单不见 编辑:程序博客网 时间:2024/04/26 06:29
#include<iostream>
#include<cstdio>
#include<cstring>
#define N 1000005
using namespace std;
int position[N];
int main()
{
memset(position,0,sizeof(position));
position[1]=0;
int next=1;
int i,j;
for(i=2;i<N;i++)
{
if(position[i])
continue;
for(j=i;j<N;j+=i)
{
position[j]=next;
}
next++;
}
int m;
while(scanf("%d",&m)!=EOF)
{
printf("%d\n",position[m]);
}
}
#include<cstdio>
#include<cstring>
#define N 1000005
using namespace std;
int position[N];
int main()
{
memset(position,0,sizeof(position));
position[1]=0;
int next=1;
int i,j;
for(i=2;i<N;i++)
{
if(position[i])
continue;
for(j=i;j<N;j+=i)
{
position[j]=next;
}
next++;
}
int m;
while(scanf("%d",&m)!=EOF)
{
printf("%d\n",position[m]);
}
}
- h
- h
- h
- ,h
- h
- h
- H
- h
- h
- h
- H
- h
- H
- H
- h
- H
- H
- h
- jqueryui 1.8.19引用顺序(及var basePrototype = new base()错误)
- Eclipse Indigo安装Spket
- 北上广未必是地狱,二三线城市未必是天堂
- Linux用户和内核空间之间的通信实现
- 从Java到嵌入式(三)——交叉编译GTK
- h
- 怎样清理浏览器缓存[各种浏览器]
- XAF之数据库数据的预填充
- Hello World!Hello CSDN!Hello Everybody
- linux粉丝(1)
- 6410 系统移植全过程
- 用键盘浏览网页
- SQL server 语句新建用户、对用户授权、删除用户实例
- 学习C#030428面向对象的程序设计