Advertisement
fbinnzhivko

01.00 Torrent Pirate.cs

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