diff --git a/du2/program.c b/du2/program.c index aec4518..613ad12 100644 --- a/du2/program.c +++ b/du2/program.c @@ -10,9 +10,9 @@ int main(){ while(1){ int value = 0; int r = scanf("%d",&value); + if(r == EOF || r < 0) + continue; if (r == 1){ - if(r == EOF) - continue; results[i] = value; if(max < results[i]){ max = results[i];