Advertisement
Guest User

asfa

a guest
Oct 7th, 2015
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _17.BookProblem
  4. {
  5.     class BookProblem
  6.     {
  7.         static void Main()
  8.         {
  9.             double bookPages = double.Parse(Console.ReadLine());
  10.             double campigDays = double.Parse(Console.ReadLine());
  11.             double pagesPerDay = double.Parse(Console.ReadLine());
  12.             campigDays = 30 - campigDays;
  13.             if (campigDays <= 0)
  14.             {
  15.                 Console.WriteLine("Never");
  16.             }
  17.             else
  18.             {
  19.                 Console.WriteLine("{0} years {1} months", Math.Floor((bookPages / (campigDays * pagesPerDay)) / 12), Math.Ceiling(bookPages / (campigDays * pagesPerDay)) % 12);
  20.             }
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement