fda
This commit is contained in:
parent
e67571d60c
commit
2b7c036569
@ -1 +1,47 @@
|
||||
jfjfj
|
||||
|
||||
|
||||
Prejsť na obsah
|
||||
Používanie služby Gmail s čítačkami obrazovky
|
||||
Konverzácie
|
||||
Využívate 105,07 GB z 200 GB
|
||||
Zmluvné podmienky · Ochrana súkromia · Pravidlá programu
|
||||
Posledná aktivita účtu pred 2 minútami
|
||||
Podrobnosti
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define MAX_COUNT 50
|
||||
|
||||
int main() {
|
||||
int results[MAX_COUNT] = {0};
|
||||
int max_value = 0;
|
||||
int value_count = 0;
|
||||
|
||||
for (int i = 0; i < MAX_COUNT; i++) {
|
||||
int r = scanf("%d", &results[i]);
|
||||
if (r == 1) {
|
||||
value_count++;
|
||||
if (results[i] > max_value) {
|
||||
max_value = results[i];
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (value_count == 0) {
|
||||
printf("Žiadne hodnoty neboli načítané.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("Maximálna hodnota bola %d.\n", max_value);
|
||||
|
||||
for (int i = 0; i < value_count; i++) {
|
||||
if (results[i] == max_value) {
|
||||
printf("Súťažiaci číslo %d dosiahol maximálnu hodnotu.\n", i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user