fbinnzhivko

01. Torrent Pirate

Mar 12th, 2016
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main()
  6.     {
  7.  
  8.         double downloadData = double.Parse(Console.ReadLine());
  9.         int cinemaPrice = int.Parse(Console.ReadLine());
  10.         int wifeSpendingPerHour = int.Parse(Console.ReadLine());
  11.  
  12.         const int DownloadSpeed = 2;
  13.         const int MovieSize = 1500;
  14.  
  15.         double dowloadTimeInSeconds = (downloadData / DownloadSpeed) / (60*60);
  16.         double pricePerDowload = dowloadTimeInSeconds * wifeSpendingPerHour;
  17.         double numberMovieDownload = downloadData / MovieSize;
  18.         double costAtCinema = numberMovieDownload * cinemaPrice;
  19.  
  20.  
  21.         if (pricePerDowload > costAtCinema)
  22.         {
  23.             Console.WriteLine("cinema -> {0:f2}lv", costAtCinema);
  24.         }
  25.         else if (pricePerDowload <= costAtCinema)
  26.         {
  27.             Console.WriteLine("mall -> {0:f2}lv", pricePerDowload);
  28.         }
  29.  
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment