iliya87

01.TravellerBob

Mar 24th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. class TravellerBob
  5.  
  6. {
  7.     static void Main()
  8.     {
  9.         string leep = Console.ReadLine();
  10.         int contracts = int.Parse(Console.ReadLine());
  11.         int family = int.Parse(Console.ReadLine());
  12.  
  13.         double numberOfTravels = contracts * 12;
  14.         numberOfTravels += family * 4;
  15.         numberOfTravels += (12 - contracts - family) * 12 * 3 / 5.0;
  16.         if (leep == "leep")
  17.         {
  18.             numberOfTravels += numberOfTravels * 5 / 100;
  19.         }
  20.         Console.WriteLine(Math.Floor(numberOfTravels));
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment