Advertisement
Guest User

01.WorkHours

a guest
Apr 14th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2.  
  3. class WorkHours
  4. {
  5.     static void Main()
  6.     {
  7.         int h = int.Parse(Console.ReadLine());
  8.         double d = double.Parse(Console.ReadLine());
  9.         double p = double.Parse(Console.ReadLine());
  10.  
  11.         double workHours = (d - (d / 10)) * 12;
  12.         double effWorkHours = workHours * (p / 100);
  13.         int diff = h - (int)Math.Floor(effWorkHours);
  14.         if (diff <= 0)
  15.         {
  16.             Console.WriteLine("Yes\n{0}", -diff);
  17.         }
  18.         else
  19.         {
  20.             Console.WriteLine("No\n{0}", -diff);
  21.         }
  22.  
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement