Advertisement
Angel_Kalinkov

TM-PF-DataTypesAndVariables-Exercises-TheaThePhotographer

Feb 4th, 2018
169
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 TheaThePhotographer
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         long photosTaken = long.Parse(Console.ReadLine());
  8.         long secondsToFilterPhoto = long.Parse(Console.ReadLine());
  9.         byte goodPhotosPercent = byte.Parse(Console.ReadLine());
  10.         long secondsToUploadPhoto = long.Parse(Console.ReadLine());
  11.  
  12.         long totalFilterSeconds = photosTaken * secondsToFilterPhoto;
  13.         long goodPhotos = (long)Math.Ceiling(photosTaken * goodPhotosPercent / 100.0);
  14.         long totalUploadSeconds = goodPhotos * secondsToUploadPhoto;
  15.         long totalTime = totalFilterSeconds + totalUploadSeconds;
  16.         long seconds = totalTime % 60;
  17.         long minutes = (totalTime / 60) % 60;
  18.         long hours = (totalTime / 60 / 60) % 24;
  19.         long days = totalTime / 60 / 60 / 24;
  20.  
  21.         Console.WriteLine($"{days}:{hours:00}:{minutes:00}:{seconds:00}");
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement