Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _19.TheaThePhotographer
- {
- class Program
- {
- static void Main(string[] args)
- {
- int totalPictures = int.Parse(Console.ReadLine());
- int filterTimePerPicture = int.Parse(Console.ReadLine());
- int factorFilteringPercentage = int.Parse(Console.ReadLine());
- int amountOfTimePerPicture = int.Parse(Console.ReadLine());
- //time for filtering
- decimal totalTime = (decimal)totalPictures * filterTimePerPicture;
- //Console.WriteLine(totalTime);
- //time for uploading good pictures
- decimal goodPictures = Math.Ceiling(factorFilteringPercentage*totalPictures/100m);
- //Console.WriteLine("goodPictures={0}",goodPictures);
- // time for uploading
- decimal timePerUploading = goodPictures*amountOfTimePerPicture;
- //Console.WriteLine(timePerUploading);
- //output the data:
- totalTime = totalTime + timePerUploading;
- //Console.WriteLine(totalTime); //total time in seconds
- //days
- decimal totalDays = Math.Floor(totalTime/(60*60*24m));
- //Console.WriteLine("days:{0}", totalDays);
- //hours
- decimal totalHours = Math.Floor(totalTime/3600m);
- //Console.WriteLine("hours:{0}", totalHours);
- //minutes
- decimal totalMinutes = Math.Floor((totalTime % 3600m)/60);
- //Console.WriteLine("minutes:{0}", totalMinutes);
- //seconds
- decimal totalSeconds = ((totalTime % 3600m)/60);
- totalSeconds = Math.Round(Math.Abs(totalMinutes - totalSeconds)*60);
- //Console.WriteLine("seconds:{0}", totalSeconds);
- //output format data
- string days =Convert.ToString(totalDays);
- string hours = Convert.ToString(totalHours);
- string minutes =Convert.ToString(totalMinutes);
- string seconds = Convert.ToString(totalSeconds);
- Console.WriteLine("{0}:{1:00}:{2:00}:{3:00}",
- totalDays, totalHours, totalMinutes, totalSeconds);
- }
- }
- }
Add Comment
Please, Sign In to add comment