Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class PiggyBank
- {
- static void Main(string[] args)
- {
- int priceOfTank = int.Parse(Console.ReadLine());
- int partyDays = int.Parse(Console.ReadLine());
- int notsaving = partyDays * 5;
- int saving = (30 - partyDays) * 2;
- int normalMonth = (30 - partyDays) * 2 - notsaving;
- if (notsaving >= saving)
- {
- Console.WriteLine("never");
- }
- else
- {
- double count = (double)priceOfTank / (double)normalMonth;
- count = Math.Ceiling(count);
- double years = count / 12;
- double monts = count % 12;
- Console.WriteLine("{0} years, {1} months",Math.Floor(years),Math.Ceiling(monts));
- }
- }
- }
Add Comment
Please, Sign In to add comment