BapBapuHa

Volleyball

Jan 27th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. package com.company;
  2.  
  3.         import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner scanner = new Scanner(System.in);
  10.         String year = scanner.nextLine();
  11.         int numberOfHolidays = Integer.parseInt(scanner.nextLine());
  12.         int homeWeekends = Integer.parseInt(scanner.nextLine());
  13.         double playWeekends = (48.0 - homeWeekends) * 3/4;
  14.         double playHolidays = 1.0 * numberOfHolidays * 2/3;
  15.         double timePlay = playHolidays + playWeekends + homeWeekends;
  16.         if (year.equals("leap")) {
  17.             timePlay = timePlay * 1.15;
  18.         }
  19.         timePlay = Math.floor(timePlay);
  20.         System.out.printf("%.0f", timePlay);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment