#include <stdio.h>
main()
{
int sum=0,a,b,c;
for(a=2;a<=100;a++)
{
c=0;
for(b=2;b<a;b++)
{
if(a%b==0)
{
c=1;
break;
}
}
if(c==0)
{
printf("%d ",a);
sum=sum+a;
}
}
printf("\n%d",sum);
getchar();
}
标签:include,int,质数,C语言,100,main
来源: https://www.cnblogs.com/xkdn/p/16695495.html