#include <stdio.h>
#include <math.h>
int main()
{
int i,j,k;
for(i=100;i<=200;i++)
{
k=sqrt(i);
for(j=2;j<=k;j++)
if(i%j==0)break;
if(j>k)printf("%d\n",i);
}
return 0;
}
转载于:https://blog.51cto.com/zhaoguanwen/1708609
#include <stdio.h>
#include <math.h>
int main()
{
int i,j,k;
for(i=100;i<=200;i++)
{
k=sqrt(i);
for(j=2;j<=k;j++)
if(i%j==0)break;
if(j>k)printf("%d\n",i);
}
return 0;
}
转载于:https://blog.51cto.com/zhaoguanwen/1708609