#include<stdio.h>
#include<math.h>
int prime(int m);
int main(void)
{
int count,m,n,sum;
count=0,sum=0;
printf("输入m n:");
scanf("%d %d",&m,&n);
for(m;m>=1&&n<=500&&m<=n;m++){
if(prime(m)!=0){
count++;sum=sum+m;}
printf("count=%d sum=%d
",count,sum);
}
printf("count=%d,sum=%d
",count,sum);
return 0;
}
int prime(int m)
{
int i, a;
if(m==1)return 0;
a=sqrt(m);
for(i=2;i<=a;i++)
if(m%i==0){
return 0;}
return 1;
}