Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String year = scanner.nextLine();
- int numberOfHolidays = Integer.parseInt(scanner.nextLine());
- int homeWeekends = Integer.parseInt(scanner.nextLine());
- double playWeekends = (48.0 - homeWeekends) * 3/4;
- double playHolidays = 1.0 * numberOfHolidays * 2/3;
- double timePlay = playHolidays + playWeekends + homeWeekends;
- if (year.equals("leap")) {
- timePlay = timePlay * 1.15;
- }
- timePlay = Math.floor(timePlay);
- System.out.printf("%.0f", timePlay);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment