kirililchev3

Thea the photographer*

May 27th, 2018
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P19_TheaThePhotographer
  4. {
  5.     class P19_TheaThePhotographer
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             long pircturesCount = int.Parse(Console.ReadLine());
  10.             int filterTime = int.Parse(Console.ReadLine());
  11.             byte filterFactor = byte.Parse(Console.ReadLine());
  12.             long uploadTime = int.Parse(Console.ReadLine());
  13.  
  14.             long timeToFilterAllPics = pircturesCount * filterTime;
  15.             int filteredPicsCount = (int)Math.Ceiling(pircturesCount * filterFactor / 100.0);
  16.             long timeToUpload = filteredPicsCount * uploadTime;
  17.             long readyTime = timeToFilterAllPics + timeToUpload;
  18.             byte seconds = (byte)(readyTime % 60);
  19.             readyTime = (readyTime - (readyTime % 60)) / 60;
  20.             byte minutes = (byte)(readyTime % 60);
  21.             readyTime = (readyTime - (readyTime % 60)) / 60;
  22.             byte hours = (byte)(readyTime % 24);
  23.             readyTime = (readyTime - (readyTime % 24)) / 24;
  24.             //int days = readyTime;
  25.  
  26.             Console.WriteLine($"{readyTime}:{hours:d2}:{minutes:d2}:{seconds:d2}");
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment