Advertisement
Atanasov_88

Untitled

Jul 5th, 2015
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using System;
  2.  
  3.     class Program
  4.     {
  5.         static void Main()
  6.         {
  7.             string leap = Console.ReadLine();
  8.             uint holidays = uint.Parse(Console.ReadLine());
  9.             uint hometownWeekends = uint.Parse(Console.ReadLine());
  10.             uint year = 52;
  11.             double playHoliday = holidays / 2;
  12.  
  13.             double normalWeekends = ((year - hometownWeekends)/3);
  14.             double normalWeekendsResult = normalWeekends * 2;
  15.            
  16.             double result = normalWeekendsResult + playHoliday + hometownWeekends;
  17.  
  18.             if (leap == "t")
  19.             {
  20.                 Console.WriteLine(Math.Round(result) + 3);
  21.             }
  22.             else
  23.             {
  24.                 Console.WriteLine(Math.Round(result, MidpointRounding.AwayFromZero));
  25.             }
  26.  
  27.         }
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement