WindFell

Thea The Photographer

Mar 18th, 2018
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 KB | None | 0 0
  1. using System;
  2.  
  3. class TheaThePhotographer
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         long picturesTaken = long.Parse(Console.ReadLine());
  8.         long filterTime = long.Parse(Console.ReadLine());
  9.         long filterFactor = long.Parse(Console.ReadLine());
  10.         long uploadTime = long.Parse(Console.ReadLine());
  11.  
  12.         long goodPictures = Convert.ToInt64(Math.Ceiling(1.0 * picturesTaken * filterFactor / 100));
  13.  
  14.         long totalFilterTime = picturesTaken * filterTime;
  15.         long totalUploadTime = goodPictures * uploadTime;
  16.         long seconds = totalFilterTime + totalUploadTime;
  17.  
  18.         long days = seconds / 86400;
  19.  
  20.         if (days > 0)
  21.         {
  22.             seconds %= days * 86400;
  23.         }
  24.  
  25.         long hours = seconds / 3600;
  26.  
  27.         if (hours > 0)
  28.         {
  29.             seconds %= hours * 3600;
  30.         }
  31.  
  32.         long minutes = seconds / 60;
  33.  
  34.         if (minutes > 0)
  35.         {
  36.             seconds %= minutes * 60;
  37.         }
  38.  
  39.         Console.WriteLine($"{days}:{hours:D2}:{minutes:D2}:{seconds:D2}");
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment