Advertisement
Kuncavia

12. Volleyball

Nov 27th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2.  
  3. class Volleyball
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         var yearType = Console.ReadLine().ToLower();
  8.         var p = double.Parse(Console.ReadLine());
  9.         var h = double.Parse(Console.ReadLine());
  10.         var volley = (h + ((48 - h) * (3.0 / 4)) + (p * (2.0 / 3)));
  11.         if (yearType == "normal")
  12.         {
  13.             Console.WriteLine(Math.Truncate(volley));
  14.         }
  15.         if (yearType == "leap")
  16.         {
  17.             Console.WriteLine(Math.Truncate((volley * 0.15) + volley));
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement