SimeonSheytanov

Volley Ball

Feb 21st, 2016
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace VolleyBall
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string yearType = Console.ReadLine();
  11.             int holidaysPerYear = int.Parse(Console.ReadLine());
  12.             int homeTownWeekends = int.Parse(Console.ReadLine());
  13.            
  14.             double gamesInSofia = (48 - homeTownWeekends)*3/4.0;
  15.             double gamesInSofiaDuringHolidays = holidaysPerYear*2/3.0;
  16.            
  17.             double totalGames = gamesInSofiaDuringHolidays + gamesInSofia + homeTownWeekends;
  18.            
  19.             if (yearType == "leap")
  20.             {
  21.                 double bonusGames = totalGames*0.15;
  22.                 totalGames += bonusGames;
  23.             }
  24.            
  25.             Console.WriteLine((int)totalGames);
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment