Advertisement
koksibg

Volleyball

Jun 30th, 2016
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Volleyball
  8. {
  9.     class Volleyball
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string year = Console.ReadLine().ToLower();
  14.             int p = int.Parse(Console.ReadLine());  // Holidays а year
  15.             int h = int.Parse(Console.ReadLine());  // Volleyball in HomeTown
  16.             int SofiaWeek = 48 - h;
  17.             var PlaySofia = (3.0 / 4) * SofiaWeek;
  18.             var PlayHolidays = (2.0 / 3) * p;
  19.             var PlaySum = PlaySofia + PlayHolidays + h;
  20.             if (year == "leap")
  21.             {
  22.                 var PlayResult = PlaySum + PlaySum * 0.15;
  23.                 Console.WriteLine(Math.Truncate(PlayResult));
  24.             }
  25.             else if (year == "normal")
  26.                 Console.WriteLine(Math.Truncate(PlaySum));
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement