mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1407.c
This commit is contained in:
parent
1f2c8e2fe4
commit
b8b1673c80
29
QUSTOJ/1407.c
Normal file
29
QUSTOJ/1407.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
#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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user