This commit is contained in:
Yaroslav Orlianskyi 2022-03-09 14:05:32 +01:00
parent 2da4cee81e
commit 77dfe1dc96
2 changed files with 6 additions and 6 deletions

Binary file not shown.

View File

@ -3,7 +3,7 @@
int main(){ int main(){
int results[VELKOST_POLA]; int results[VELKOST_POLA];
int max; //int max;
//int value = 0; //int value = 0;
int i = 0; int i = 0;
int a = 0; int a = 0;
@ -12,18 +12,18 @@ int main(){
int r = scanf("%d",&value); int r = scanf("%d",&value);
if (r == 1){ if (r == 1){
results[i] = value; results[i] = value;
max = results[0]; //max = results[0];
if(max < results[i]) /*if(max < results[i])
max = results[i]; max = results[i];*/
i++; i++;
}else{ }else{
break; break;
} }
} }
do{ do{
printf("Súťažiaci č. %d vypil %d pohárovav.\n", results[a], results[a]); printf("Súťažiaci č. %d vypil %d pohárovav.\n", /*results[a]*/a+1, results[a]);
if(a == i - 1){ if(a == i - 1){
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", max, max); printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", a+1, results[a]);
break; break;
} }
a++; a++;