1
0
mirror of https://github.com/Oxbian/CodingGame.git synced 2025-07-05 19:43:33 +02:00
Files
CodingGame/C/Easy_Challenges/the_descent.c
Arkagedon d894ebe609 update codingame challenges
Adding python challenges and sorting the challenges
2022-03-13 18:15:15 +01:00

27 lines
549 B
C
Executable File

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
int main()
{
// game loop
while (1) {
int mountain_max = 0, mountain_Id = 0;
for (int i = 0; i < 8; i++) {
// represents the height of one mountain.
int mountain_h;
scanf("%d", &mountain_h);
if (mountain_h > mountain_max)
{
mountain_max = mountain_h;
mountain_Id = i;
}
}
printf("%d\n",mountain_Id);
}
return 0;
}