Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class _1_Volleyball {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner scan = new Scanner(System.in);
- String year = scan.next();
- int holidays = scan.nextInt();
- int hometownWeekends = scan.nextInt();
- int allWeekends = 48;
- int normalWeekends = allWeekends - hometownWeekends;
- double playTimes = hometownWeekends;
- playTimes += ((double) normalWeekends * 3) / 4;
- playTimes += ((double) holidays * 2) / 3;
- if (year.equals("leap")) {
- playTimes *= 1.15;
- }
- int totalPlayDays = (int) playTimes;
- System.out.println(totalPlayDays);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement