Pagini recente » Cod sursa (job #2819975) | Cod sursa (job #552138) | Cod sursa (job #121733) | Cod sursa (job #73152) | Cod sursa (job #230080)
Cod sursa(job #230080)
#include<stdio.h>
int n,x,y=4;
int main()
{
int i=2,suma=0;
bool ok=true;
freopen("sum.in","r",stdin);
freopen("sum.out","w",stdout);
scanf("%d%d",&n,&x);
while(y<=2*x)
{
for(i=2;i<=y/2 && ok!=false;++i)
{
if(y%x==0 && y%i!=0)
ok=true;
else ok=false;
}
if(y==2*x)
{
printf("%d\n",suma);
scanf("%d",&x);
suma=0;
}
if(ok==true)
suma=suma+y;
++y;
ok=true;
}
return 0;
}