Advertisement
Guest User

Untitled

a guest
Feb 4th, 2018
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 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. ulong N = ulong.Parse(Console.ReadLine());
  15. ulong FT = ulong.Parse(Console.ReadLine());
  16. ulong FF = ulong.Parse(Console.ReadLine());
  17. ulong UT = ulong.Parse(Console.ReadLine());
  18.  
  19. ulong hours=0;
  20. ulong minutes=0;
  21. ulong day = 0;
  22.  
  23. ulong first = N * FT;
  24. ulong second = (ulong)Math.Ceiling((N * (FF / 100.0)) );
  25. second = second * UT;
  26. ulong 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