Advertisement
igrilkul

Thea the photographer

Feb 4th, 2018
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.25 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace SoftUni
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             int N = int.Parse(Console.ReadLine());
  15.             int FT = int.Parse(Console.ReadLine());
  16.             int FF = int.Parse(Console.ReadLine());
  17.             int UT = int.Parse(Console.ReadLine());
  18.  
  19.             int hours=0;
  20.             int minutes=0;
  21.             int day = 0;
  22.            
  23.             int first = N * FT;
  24.             int second = (int)Math.Ceiling(((double)N * (FF / 100.0f)) );
  25.             second = second * UT;
  26.             int seconds = first + second;
  27.            
  28.             if (seconds >= 86400) {
  29.                 day = seconds / 86400;
  30.                 seconds -= 86400*day;
  31.             }
  32.             if(seconds>=3600)
  33.             {
  34.                  hours = seconds / 3600;
  35.                 seconds -= 3600 * hours;
  36.             }
  37.             if(seconds>=60)
  38.             {
  39.                minutes = seconds / 60;
  40.                 seconds -= 60 * minutes;
  41.             }
  42.            
  43.             Console.WriteLine($"{day:0}:{hours:00}:{minutes:00}:{seconds:00}");
  44.  
  45.            
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement