Advertisement
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 Back_To_The_Past
- {
- class Back_To_The_Past
- {
- static void Main(string[] args)
- {
- double Money = double.Parse(Console.ReadLine());
- int Year = int.Parse(Console.ReadLine());
- int AgesNow = 18;
- for (int i = 0; i <= Year - 1800; i++)
- {
- if (i % 2 == 0)
- {
- Money -= 12000;
- }
- else
- {
- Money -= 12000 + 50 * AgesNow;
- }
- AgesNow++;
- }
- if (Money >= 0) Console.WriteLine("Yes! He will live a carefree life and will have {0:f2} dollars left.", Money);
- else Console.WriteLine("He will need {0:f2} dollars to survive.", Math.Abs(Money));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement