Advertisement
fbinnzhivko

01.01 Torrent Pirate

May 5th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2. class TorrentPirate
  3. {
  4.     static void Main()
  5.     {
  6.         int d = Int32.Parse(Console.ReadLine());
  7.         int p = Int32.Parse(Console.ReadLine());
  8.         int w = Int32.Parse(Console.ReadLine());
  9.  
  10.         double downloadTime = (double)d / 2 / 60 / 60;
  11.         double costAtMall = downloadTime * w;
  12.         double numberOfMovies = (double)d / 1500;
  13.         double costAtCinema = numberOfMovies * p;
  14.  
  15.         if (costAtMall > costAtCinema)
  16.         {
  17.             Console.WriteLine("cinema -> {0:0.00}lv", costAtCinema);
  18.         }
  19.         else
  20.         {
  21.             Console.WriteLine("mall -> {0:0.00}lv", costAtMall);
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement