TOPIC
o que pode estar errado?
tgoncalves19 asked 4 years ago
int x, soma = 0, cont = 0;
while(1){
scanf("%d", &x);
if(x == 0){
break;
}
if(x % 2 == 0){
while(cont != 5){
soma += x;
x += 2;
cont++;
}
printf("%d\n",soma);
cont = 0;
soma = 0;
x = 0;
}
if(x % 2 == 1){
x++;
while(cont != 5){
soma += x;
x += 2;
cont++;
}
printf("%d\n",soma);
cont = 0;
soma = 0;
x = 0;
}
}
This topic was solved and cannot recieve new replies.