rado8506

Tom cat

Jan 19th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 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 ConsoleApp1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int Wekends = int.Parse(Console.ReadLine());
  14.             int workdays = 365 - Wekends;
  15.             int Playmin = (Wekends * 127) + (workdays * 63);
  16.             double difference = 30000 - Playmin;
  17.             double hour = Math.Abs(difference / 60);
  18.             double mins = Math.Abs(difference % 60);
  19.  
  20.             if (30000 < Playmin)
  21.             {
  22.                 Console.WriteLine("Tom will run away");
  23.                 Console.WriteLine("{0} hours and {1} minutes more for play", Math.Floor(hour), Math.Floor(mins));
  24.             }
  25.             else
  26.             {
  27.                 Console.WriteLine("Tom sleeps well");
  28.                 Console.WriteLine("{0} hours and {1} minutes less for play", Math.Floor(hour), Math.Floor(mins));
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment