Advertisement
fbinnzhivko

01.00 Volleyball

May 2nd, 2016
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         string year = Console.ReadLine();
  7.         int p = int.Parse(Console.ReadLine());
  8.         int hometown = int.Parse(Console.ReadLine());
  9.  
  10.         if (year == "normal")
  11.         {
  12.             int weeks = 48;
  13.             double x = ((weeks - hometown) * (3.0 / 4.0)) + (p * (2.0 / 3.0)) + hometown;
  14.             Console.WriteLine(Math.Floor(x));
  15.         }
  16.         else if (year == "leap")
  17.         {
  18.             double x1 = (((48 - hometown) * (3.0 / 4.0)) + (p * (2.0 / 3.0)) + hometown) * 1.15;
  19.             Console.WriteLine(Math.Floor(x1));
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement