Advertisement
Filkolev

Volleyball

Jul 20th, 2014
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2.  
  3.     class Volleyball
  4.     {
  5.         static void Main()
  6.         {
  7.             string year = Console.ReadLine();
  8.             short p = short.Parse(Console.ReadLine());
  9.             byte h = byte.Parse(Console.ReadLine());
  10.             int weekendsInYear = 48;
  11.  
  12.             double nomalWeekEndsPlay = (weekendsInYear - h) * 0.75;
  13.             double playingHolidays = p * 2 / 3.0;
  14.         double totalPlays = nomalWeekEndsPlay + playingHolidays + h;
  15.            
  16.             if (year == "leap")
  17.             {              
  18.                 totalPlays += totalPlays *0.15;                            
  19.             }
  20.  
  21.         Console.WriteLine(Math.Floor(totalPlays));
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement