Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PigyBank
- {
- class Program
- {
- static void Main(string[] args)
- {
- int thePriceOfTheTank = int.Parse(Console.ReadLine());
- int paryDaysInAMonth = int.Parse(Console.ReadLine());
- int normalDays = 30 - paryDaysInAMonth;
- int a = normalDays * 2;
- int spentOnParyDays = paryDaysInAMonth * 5;
- int levaPerMonth = a - spentOnParyDays;
- double month = (double)thePriceOfTheTank / levaPerMonth;
- //decimal x = ( Math.Ceiling(( ( month / 12 ) - ( (int)month / 12 ) ) * 12) );
- int years = (int)Math.Ceiling(month) / 12;
- int months = (int)Math.Ceiling(month) % 12;
- if(month > 0)
- {
- Console.WriteLine("{0} years, {1} months" , years , months);
- }
- else
- {
- Console.WriteLine("never");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment