zh_stoqnov

WorkHours

Oct 25th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. using System;
  2.  
  3. namespace WorkHours
  4. {
  5. class WorkHours
  6. {
  7. public static void Main(string[] args)
  8. {
  9. int h = int.Parse(Console.ReadLine());
  10. int d = int.Parse(Console.ReadLine());
  11. int p = int.Parse(Console.ReadLine());
  12. double normalWorkDay = 12;
  13. double daysAfterBiking = (double)((double)d - ((double)d * 0.1));
  14. double hoursAfterBiking = (double)(daysAfterBiking * normalWorkDay);
  15. double efficientHours = (double)(hoursAfterBiking * ((double)p / 100));
  16. int efficientWorkHours = (int)Math.Floor(efficientHours);
  17. if(efficientWorkHours >= h)
  18. {
  19. Console.WriteLine("Yes");
  20. Console.WriteLine(efficientWorkHours - h);
  21. }
  22. else
  23. {
  24. Console.WriteLine("No");
  25. Console.WriteLine(efficientWorkHours - h);
  26. }
  27.  
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment