Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class p12_Volleyball {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- String year = scan.nextLine().toLowerCase();
- int pHoliday = Integer.parseInt(scan.nextLine());
- int hTownWEnds = Integer.parseInt(scan.nextLine());
- int sofWEnds = 48 - hTownWEnds;
- double sofPlaying = 3 / 4.0 * sofWEnds;
- int htPlaying = hTownWEnds;
- double holidayPlaying = 2 / 3.0 * pHoliday;
- double playing = sofPlaying + htPlaying + holidayPlaying;
- if (year.equals("leap")) {
- playing = 1.15 * playing;
- }
- System.out.println((int)Math.floor(playing));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement