Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class piggybank
- {
- static void Main()
- {
- int pTank = int.Parse(Console.ReadLine());
- int pDays = int.Parse(Console.ReadLine());
- int pBank = ((30 - pDays) * 2) - (pDays * 5);
- if (pDays >= 9)
- {
- Console.WriteLine("never");
- return;
- }
- double totaMonths = (double)pTank / pBank;
- int result = (int)Math.Ceiling(totaMonths);
- int years = result / 12;
- int months2 = result % 12;
- Console.WriteLine("{0} years, {1} months", years, months2);
- }
- }
Add Comment
Please, Sign In to add comment