Advertisement
fbinnzhivko

01. Traveller Bob

Apr 2nd, 2016
162
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. class Program
  3. {
  4.     static void Main()
  5.     {
  6.  
  7.         string year = Console.ReadLine();
  8.         int outOfHome = int.Parse(Console.ReadLine());
  9.         int home = int.Parse(Console.ReadLine());
  10.  
  11.         int travels = outOfHome * 12;
  12.         int family = home * 4;
  13.         double normal = (12 - outOfHome - home) * 12 * 3.0/5;
  14.         double total = travels + family + normal;
  15.  
  16.         if (year == "leap")
  17.         {
  18.             total = total * 1.05;
  19.         }
  20.         Console.WriteLine("{0}", Math.Floor(total));
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement