mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
30 lines
475 B
C
30 lines
475 B
C
#include <stdio.h>
|
|
int main()
|
|
{
|
|
long inc;
|
|
if(scanf("%d",&inc)!=1)
|
|
{
|
|
return -1;
|
|
}
|
|
else
|
|
{
|
|
long i,cur;
|
|
for(cur=2;cur<=inc;cur++)
|
|
{
|
|
for(i=2;i<cur;i++)
|
|
{
|
|
if(cur%i==0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
if(i==cur)
|
|
{
|
|
printf("%d ",cur);
|
|
}
|
|
}
|
|
printf("\n");
|
|
}
|
|
return 0;
|
|
}
|