funguje
This commit is contained in:
parent
c98475792c
commit
3f0c3eeeca
BIN
du2/program
Executable file
BIN
du2/program
Executable file
Binary file not shown.
@ -10,18 +10,18 @@ int main(){
|
||||
int drinks_counter[VELKOST_POLA];
|
||||
int i=0;
|
||||
while(i<VELKOST_POLA){
|
||||
scanf("%d",drinks_counter[i]);
|
||||
if(drink_counter[i]<1){
|
||||
scanf("%d",&drinks_counter[i]);
|
||||
if(drinks_counter[i]<1){
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
struct Winner max={0,0};
|
||||
for(int j=0;j<i;j++){
|
||||
printf("Súťažiaci č.%d vypil %d pohárov.\n",j,drinks_counter[j]);
|
||||
printf("Súťažiaci č.%d vypil %d pohárov.\n",j+1,drinks_counter[j]);
|
||||
if(drinks_counter[j]>max.drinks){
|
||||
max.drinks=drinks_counter[j];
|
||||
max.position=j;
|
||||
max.position=j+1;
|
||||
}
|
||||
}
|
||||
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n",max.position,max.drinks);
|
||||
|
Loading…
Reference in New Issue
Block a user