Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class demo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String year = scanner.nextLine();
- double holidays = Double.parseDouble(scanner.nextLine());
- double weekends = Double.parseDouble(scanner.nextLine());
- double sofia = (48 - weekends) * 3.0/4;
- double holidaysGames = holidays * 2.0/3;
- double totalGames = sofia + weekends + holidaysGames; // 45
- if(year.equals("leap")){
- totalGames *= 1.15;
- }
- double result = Math.floor(totalGames);
- System.out.printf("%.0f", result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement