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 sc = new Scanner(System.in);
- String year = sc.nextLine(); //leap, normal
- int holidays = Integer.parseInt(sc.nextLine());
- int weekends = Integer.parseInt(sc.nextLine());
- double sofiaPlays1 = (48 - weekends) * 3 / 4.0;
- double sofiaPlays2 = holidays * 2.0 / 3;
- double totalPlay = weekends + sofiaPlays1 + sofiaPlays2;
- if (year.equals("leap")) {
- totalPlay += 0.15 * totalPlay;
- }
- System.out.println(Math.floor(totalPlay));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement