Advertisement
marmotka

Point on Figure

Mar 28th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. public class p12_Volleyball {
  5.     public static void main(String[] args) {
  6.         Scanner scan = new Scanner(System.in);
  7.  
  8.         String year = scan.nextLine().toLowerCase();
  9.         int pHoliday = Integer.parseInt(scan.nextLine());
  10.         int hTownWEnds = Integer.parseInt(scan.nextLine());
  11.  
  12.         int sofWEnds = 48 - hTownWEnds;
  13.         double sofPlaying = 3 / 4.0 * sofWEnds;
  14.         int htPlaying = hTownWEnds;
  15.         double holidayPlaying = 2 / 3.0 * pHoliday;
  16.  
  17.         double playing = sofPlaying + htPlaying + holidayPlaying;
  18.  
  19.  
  20.         if (year.equals("leap")) {
  21.             playing = 1.15 * playing;
  22.         }
  23.         System.out.println((int)Math.floor(playing));
  24.         }
  25.  
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement