Create 1407.c

This commit is contained in:
Kirigaya Kazuto 2016-06-11 20:19:03 +08:00 committed by GitHub
parent 1f2c8e2fe4
commit b8b1673c80

29
QUSTOJ/1407.c Normal file
View 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;
}