sandeep-vaas / icpc-algo

0 stars 25 forks source link

Prime Number or Not O(Sqrt(N)) - C++ #4

Open sandeep-vaas opened 7 years ago

tiagokapp commented 7 years ago

include

main() {

int n, cont, primo, s,seq;
printf("digite quantos numeros primos vc deseja");
scanf("%d",&n);
s=0;
seq=0;
while (cont<=n)
{
    printf("digite a sequencia de numeros primos");
    scanf("%d",&seq);

    cont=cont+1;

    if (seq%1==seq && seq%seq==0)
    {
        seq=seq+1;

    s=s+seq;
    }

}

    printf("o valor dos numeros primos eh %d\n\n\n",seq);
    printf("%d\n\n\n", s);

}