Advertisement
Guest User

Untitled

a guest
Oct 25th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace p_02
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             int allPicturesTaken = int.Parse(Console.ReadLine());
  15.             int filterPictures = int.Parse(Console.ReadLine());
  16.             int filterFactor = int.Parse(Console.ReadLine());
  17.             int uploadTime = int.Parse(Console.ReadLine());
  18.             long usefulPictures = (long)Math.Ceiling(allPicturesTaken * (filterFactor / 100.0));
  19.             long filterTime = (long)allPicturesTaken * filterPictures;
  20.             long alltime = filterTime + (usefulPictures * uploadTime);
  21.  
  22.             TimeSpan time = TimeSpan.FromSeconds(alltime);
  23.             Console.WriteLine($"{time.Days:D1}:{time.Hours:D2}:{time.Minutes:D2}:{time.Seconds:D2}");
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement