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 BackToThePast
- {
- class Program
- {
- static void Main(string[] args)
- {
- decimal ost = decimal.Parse(Console.ReadLine());
- uint godina = uint.Parse(Console.ReadLine());
- //while (godina<1801|| godina > 1900) { godina = uint.Parse(Console.ReadLine()); }
- uint count = 18u;
- for (uint i = 1800; i<= godina; i++)
- {
- if (i % 2 == 0)
- {
- ost -= 12000;
- }
- else
- {
- ost -= (12000 + 50 * (decimal)count);
- //Console.WriteLine(count);
- //Console.WriteLine((decimal)count);
- }
- count++;
- }
- if (ost < 0)
- {
- Console.WriteLine("He will need {0:F2} dollars to survive.", Math.Abs(ost));
- }
- else
- {
- Console.WriteLine("Yes! He will live a carefree life and will have {0:F2} dollars left.",ost);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement