Advertisement
fbinnzhivko

Untitled

Sep 25th, 2016
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         var nPictures = int.Parse(Console.ReadLine());
  7.         var filterSeconds = int.Parse(Console.ReadLine());
  8.         var PercentUseful = int.Parse(Console.ReadLine());
  9.       long secondsUpload = int.Parse(Console.ReadLine());
  10.  
  11.  
  12.         var TimeFiltering = nPictures * filterSeconds;
  13.        var nUseful =(int)Math.Ceiling((nPictures * PercentUseful) / 100.0);
  14.  
  15.         long totalUpload = secondsUpload * nUseful;
  16.  
  17.         long totalSec = TimeFiltering + totalUpload;
  18.         long days = totalSec / 86400;
  19.         long daysLeft = totalSec % 86400;
  20.         long hours = daysLeft / 3600;
  21.         long hoursLeft = daysLeft % 3600;
  22.         long min = hoursLeft / 60;
  23.         long sec = hoursLeft % 60;
  24.  
  25.  
  26.         Console.WriteLine("{0}:{1:D2}:{2:D2}:{3:D2}", days, hours, min, sec);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement