28 lines
533 B
C
28 lines
533 B
C
|
# include <stdio.h>
|
||
|
# include <stdlib.h>
|
||
|
|
||
|
int main(void) {
|
||
|
int resultats[5];
|
||
|
int i;
|
||
|
int max;
|
||
|
int compteur_occurences;
|
||
|
for (i = 0; i != 5; i++) {
|
||
|
printf("Jet n°%d : ", i+1);
|
||
|
scanf("%d", &resultats[i]);
|
||
|
getchar();
|
||
|
}
|
||
|
max = resultats[0];
|
||
|
for (i = 0; i != 5; i++) {
|
||
|
if (resultats[i] > max) {
|
||
|
max = resultats[i];
|
||
|
}
|
||
|
}
|
||
|
compteur_occurences = 0;
|
||
|
for (i = 0; i != 5; i++) {
|
||
|
if (max == resultats[i]) {
|
||
|
compteur_occurences++;
|
||
|
}
|
||
|
}
|
||
|
printf("Occurences maximum : %d\n", compteur_occurences);
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|