Advertisement
Venciity

[Java] JoroTheFootballPlayer

May 6th, 2014
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. // http://judge.softuni.bg/Contests/2/CSharp-Basics-Exam-10-April-2014-Morning
  2. import java.util.Scanner;
  3.  
  4.  
  5. public class JoroTheFootballPlayer {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner input = new Scanner(System.in);
  9.         char isLeap = input.findInLine(".").charAt(0);
  10.         int holidayCount = input.nextInt();
  11.         int weekendsHomeCount = input.nextInt();
  12.  
  13.         int totalWeekendsInYear = 52;
  14.        
  15.         int normalWeekends = totalWeekendsInYear - weekendsHomeCount;
  16.        
  17.         double gamesCount = normalWeekends * 2d / 3d + weekendsHomeCount * 1d + holidayCount / 2d;
  18.        
  19.         if (isLeap == 't') {
  20.             gamesCount += 3;
  21.         }
  22.        
  23.         System.out.print((int)gamesCount);
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement