Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Volleyball {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String year = scanner.nextLine();
- int holiday = Integer.parseInt(scanner.nextLine());
- int weekends = Integer.parseInt(scanner.nextLine());
- int weekendSofia = 48-weekends;
- double saturdayGamesSofia = weekendSofia*(3.0/4.0);
- double holidayGamesSofia = holiday*(2.0/3.0);
- double allGame = saturdayGamesSofia+holidayGamesSofia+weekends;
- if ("leap".equals(year)) {
- allGame += allGame*0.15;
- }
- System.out.printf("%.0f", Math.floor(allGame));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement