Advertisement
bacco

Волейбол

Jan 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.37 KB | None | 0 0
  1. using System;
  2.  
  3. namespace tESt
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.  
  11.             var yearType = Console.ReadLine().ToLower();
  12.             var holidays = double.Parse(Console.ReadLine());
  13.             var weekends = double.Parse(Console.ReadLine());
  14.  
  15.             if (yearType == "normal")
  16.             {
  17.                 var weekendsSofia = 48 - weekends;
  18.  
  19.                 var saturdayGames = (weekendsSofia * (3 / 4.0));
  20.  
  21.                 var sundayGames = weekends;
  22.  
  23.                 var gamesSofiaHolidays = holidays * (2 / 3.0);
  24.  
  25.                 var totalResult = saturdayGames + sundayGames + gamesSofiaHolidays;
  26.  
  27.                 Console.WriteLine(Math.Floor(totalResult));
  28.  
  29.             }
  30.             else if (yearType == "leap")
  31.             {
  32.                 var weekendsSofia = 48 - weekends;
  33.  
  34.                 var saturdayGames = (weekendsSofia * (3 / 4.0));
  35.  
  36.                 var sundayGames = weekends;
  37.  
  38.                 var gamesSofiaHolidays = holidays * (2 / 3.0);
  39.  
  40.                 var totalResult = saturdayGames + sundayGames + gamesSofiaHolidays;
  41.  
  42.                 var leapTotalResult = totalResult + (totalResult * 0.15);
  43.  
  44.                 Console.WriteLine(Math.Floor(leapTotalResult));
  45.  
  46.             }
  47.             else
  48.             {
  49.                 Console.WriteLine("Error!");
  50.             }
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement