TOPIC

não consigo achar o erro de 35%

mborges32 asked 4 years ago

include

int main() { int nlesmas,v,i,maior;

while(scanf("%d", &nlesmas) != EOF){ maior = 0; for(i = 0; i < nlesmas; i++){ scanf("%d", &v); if (v > maior){ maior = v; } }if (v < 10){ printf("1\n"); } else if (v < 20){ printf ("2\n"); } else { printf ("3\n"); } }

return 0;

}

This topic was solved and cannot recieve new replies.

  • feodorv replied 4 years ago

    Not v but maior:

    if (maior < 10) printf("1\n"); else if (maior < 20) printf ("2\n"); else printf ("3\n");