Created
November 1, 2017 13:37
-
-
Save WillemVansteyvoort/8e25fb4ca309c8403eb7671e87890cf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner invoer = new Scanner(System.in); | |
int testgevallen; | |
int punten; | |
int sprongen; | |
testgevallen = invoer.nextInt(); | |
for (int i = 1; i <= testgevallen; i++) { | |
sprongen = invoer.nextInt(); | |
punten = 0; | |
for (int f = 0; f < sprongen; f++){ | |
int seconden = invoer.nextInt(); | |
if (seconden > 4) { | |
punten += 100; | |
seconden -= 4; | |
} else { | |
punten += seconden*25; | |
seconden -= seconden; | |
} | |
if (seconden > 4) { | |
punten += 400; | |
seconden -= 4; | |
} else { | |
punten += 100*seconden; | |
seconden -= seconden; | |
} | |
if (seconden > 4) { | |
punten += 2000; | |
seconden -= 4; | |
} else { | |
punten += 500*seconden; | |
seconden -= seconden; | |
} | |
if (seconden > 0) { | |
punten += seconden*1000; | |
} | |
} System.out.println(i + " " + punten); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Opdracht: http://www.vlaamseprogrammeerwedstrijd.be/2016/opgaven/cat1/heuvelrace/heuvelrace.pdf