int main(){
int n,j,i,k=0,m;
int sum,num=0;
scanf("%d%d", &n,&m);
for(j=n;j<=m;j++)
{
int n = j;
for (i = 2; i < n; i++)
{
if (n % i == 0) break;
}
if(i<n)
{
continue;//跳出上一层for循环
}
else
{
printf("%d\n", j);
num++;
sum = sum + j;
}
}
printf("%d %d", num, sum);
}
09-19
813
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-10
54
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-17
2942
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-17
160
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-17
1087
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)