MiroslavKisov

Volleyball

Jul 26th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 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.             string yearType=Console.ReadLine();
  14.             double holidays = double.Parse(Console.ReadLine());
  15.             double weekends = double.Parse(Console.ReadLine());
  16.             double weekendsInSofia = (48.0-weekends)*(3.0/4.0);
  17.             double holidaysInSofia = holidays * (2.0 / 3.0);
  18.             double result = holidaysInSofia + weekendsInSofia + weekends;
  19.             switch (yearType)
  20.             {
  21.                 case "normal":
  22.                     Console.WriteLine(Math.Floor(result));
  23.                     break;
  24.                 case "leap":
  25.                     result = result + result * 0.15;
  26.                     Console.WriteLine(Math.Floor(result));
  27.                     break;
  28.                 default:
  29.                     break;
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment