Advertisement
TodorovP

Volleyball

Jan 31st, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 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 Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var typeOfYear = Console.ReadLine(); // “leap” or “normal”
  14.             var p = int.Parse(Console.ReadLine()); // празници без съб и нед
  15.             var h = int.Parse(Console.ReadLine()); // уикенди в родния град
  16.  
  17.             double voleyballDaysSofia = ((48 - h) * 3 / 4.0) + p * 2 / 3.0;
  18.             double voleyballDays = voleyballDaysSofia + h;
  19.  
  20.             double additionalVoley = 0;
  21.             if (typeOfYear == "leap")
  22.             {
  23.                 additionalVoley = voleyballDays * 15 / 100.0;
  24.                 voleyballDays += additionalVoley;
  25.             }
  26.  
  27.             voleyballDays = Math.Floor(voleyballDays);
  28.             Console.WriteLine(voleyballDays);
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement