SAD
This commit is contained in:
parent
8b7b1f1697
commit
12e7288a76
BIN
du2/.program.c.swl
Normal file
BIN
du2/.program.c.swl
Normal file
Binary file not shown.
BIN
du2/.program.c.swm
Normal file
BIN
du2/.program.c.swm
Normal file
Binary file not shown.
BIN
du2/.program.c.swn
Normal file
BIN
du2/.program.c.swn
Normal file
Binary file not shown.
BIN
du2/.program.c.swo
Normal file
BIN
du2/.program.c.swo
Normal file
Binary file not shown.
BIN
du2/program
BIN
du2/program
Binary file not shown.
@ -1,19 +1,33 @@
|
||||
#include <stdio.h>
|
||||
#define VELKOST_POLA 52
|
||||
#define VELKOST_POLA 50
|
||||
|
||||
int main(){
|
||||
int results[50];
|
||||
int results[VELKOST_POLA];
|
||||
int max;
|
||||
int vysledky[VELKOST_POLA] = {0,0,0,0};
|
||||
//int value = 0;
|
||||
int i = 0;
|
||||
printf("1 2 3 4 5");
|
||||
int a = 0;
|
||||
while(1){
|
||||
scanf("%d", results[i]);
|
||||
if(results[i] == 1)
|
||||
printf("Úspešne som načítal hodnotu %d\n",results[i]);
|
||||
else
|
||||
printf("Načítanie sa nepodarilo. V premennej value ostala pôvodná hodnota. \n");
|
||||
i++;
|
||||
int value = 0;
|
||||
int r = scanf("%d",&value);
|
||||
if (r == 1){
|
||||
printf("Úspešne som načítal hodnotu %d\n",value);
|
||||
results[i] = value;
|
||||
max = results[0];
|
||||
if(max < results[i])
|
||||
max = results[i];
|
||||
i++;
|
||||
}else{
|
||||
do{
|
||||
printf("Súťažiaci č. %d vypil %d pohárovav.\n", results[a], results[a]);
|
||||
if(a == i - 1){
|
||||
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", max, max);
|
||||
break;
|
||||
}
|
||||
a++;
|
||||
}while(a < i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user