Advertisement
veronikaaa86

Thea The Photographer

Nov 23rd, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. namespace Ex19_TheaThePhotographer
  2. {
  3.     using System;
  4.     public class Program
  5.     {
  6.         public static void Main(string[] args)
  7.         {
  8.             int picturesCount = int.Parse(Console.ReadLine());
  9.             int filerTime = int.Parse(Console.ReadLine());
  10.             int filterFactor = int.Parse(Console.ReadLine());
  11.             int uploadTime = int.Parse(Console.ReadLine());
  12.  
  13.             double filteredPictures = Math.Ceiling(picturesCount * (filterFactor / 100.0));
  14.             double filterTimeForAlPics = (double)filerTime * picturesCount;
  15.             double uploadTimeForilteredPics = uploadTime * filteredPictures;
  16.  
  17.             double totalTime = filterTimeForAlPics + uploadTimeForilteredPics;
  18.             //double totalTime = filterTimeForAlPics + uploadTime;
  19.  
  20.             TimeSpan result = TimeSpan.FromSeconds(totalTime);
  21.  
  22.             string format = result.ToString(@"d\:hh\:mm\:ss");
  23.                                 //ToString(@"d\:hh:\:mm\:ss");
  24.             Console.WriteLine(format);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement