Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner Scanner = new Scanner(System.in);
- String year = Scanner.nextLine();
- int p = Integer.parseInt(Scanner.nextLine());
- int h = Integer.parseInt(Scanner.nextLine());
- int S = 48 - h;
- double gS = S * 3.0 / 4;
- double gH = h;
- double gP = p * 2.0 / 3;
- double games = gS + gH + gP;
- double AllGames = 0;
- switch (year){
- case "leap":
- AllGames = games + games * 15 / 100;
- System.out.println(Math.floor(AllGames));
- break;
- case "normal":
- AllGames= games;
- System.out.println(Math.floor(AllGames));
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement