MartinPaunov

19. Thea The Photographer

Jan 30th, 2018
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3. using System.Text;
  4.  
  5. namespace CSharpDemos
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             int pictures = int.Parse(Console.ReadLine());
  12.             int filterTime = int.Parse(Console.ReadLine());
  13.             int filterFactor = int.Parse(Console.ReadLine());
  14.             int uploadTime = int.Parse(Console.ReadLine());
  15.  
  16.             int filteredPictures = (int)Math.Ceiling(pictures * filterFactor / 100.0);
  17.             long timeForFiltering = (long)pictures * filterTime;
  18.             long timeForUpload = (long)filteredPictures * uploadTime;
  19.             long totalTime = timeForFiltering + timeForUpload;
  20.  
  21.             TimeSpan time = TimeSpan.FromSeconds(totalTime);
  22.  
  23.             string format = time.ToString(@"d\:hh\:mm\:ss");
  24.  
  25.             Console.WriteLine(format);
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment