Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // game loop
- while (true) {
- int S = in.nextInt(); // the motorbike's speed.
- int X = in.nextInt(); // the position on the road of the motorbike.
- if(X == R - 1) {
- System.out.println("JUMP");
- } else if((X > R + G) || (X + S > R) || (G+1 < S)) {
- System.out.println("SLOW");
- } else if(G+1 == S) {
- System.out.println("WAIT");
- } else {
- System.out.println("SPEED");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement