Advertisement
ad2bg

Volleyball

Oct 28th, 2017
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. namespace Volleyball
  2. {
  3.     using System;
  4.  
  5.     class Volleyball
  6.     {
  7.         static void Main()
  8.         {
  9.             string year = Console.ReadLine().ToLower();
  10.             int holidays = int.Parse(Console.ReadLine());
  11.             int weekendsHome = int.Parse(Console.ReadLine());
  12.  
  13.             int sofiaWeekends = 48 - weekendsHome;
  14.  
  15.             double playSofia = 3.0 * sofiaWeekends / 4 + 2.0 * holidays / 3;
  16.             double playTotal = playSofia + weekendsHome;
  17.  
  18.             if (year=="leap")
  19.             {
  20.                 playTotal *= 1.15;
  21.             }
  22.  
  23.             Console.WriteLine((int)playTotal);
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement