Advertisement
Mishakis

Volleyball

Jul 18th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner Scanner = new Scanner(System.in);
  7.  
  8.         String year = Scanner.nextLine();
  9.         int p = Integer.parseInt(Scanner.nextLine());
  10.         int h = Integer.parseInt(Scanner.nextLine());
  11.  
  12.         int S = 48 - h;
  13.         double gS = S * 3.0 / 4;
  14.         double gH = h;
  15.         double gP = p * 2.0 / 3;
  16.         double games = gS + gH + gP;
  17.         double AllGames = 0;
  18.  
  19.         switch (year){
  20.             case "leap":
  21.                 AllGames = games + games * 15 / 100;
  22.                 System.out.println(Math.floor(AllGames));
  23.                 break;
  24.             case "normal":
  25.                 AllGames= games;
  26.                 System.out.println(Math.floor(AllGames));
  27.                 break;
  28.         }
  29.  
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement