VelizarAvramov

12. Volleyball

Mar 22nd, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 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 _11_Volleyball
  8. {
  9.     class volleyball
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string leap = Console.ReadLine();
  14.             int hollidays = int.Parse(Console.ReadLine());
  15.             int weekendhometown = int.Parse(Console.ReadLine());
  16.             int allWeekendyear = 48;
  17.             int weekendSofia = allWeekendyear - weekendhometown;
  18.  
  19.             double games = (weekendSofia * 3.0 / 4) + (hollidays * 2.0 / 3) + weekendhometown;
  20.             if (leap == "normal")
  21.             {
  22.                 Console.WriteLine(Math.Truncate(games));
  23.             }
  24.             else if (leap == "leap")
  25.             {
  26.                 Console.WriteLine(Math.Truncate(games * 1.15));
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment