SHARE
TWEET

Untitled

a guest Jun 26th, 2017 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace BackToThePast
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             decimal ost = decimal.Parse(Console.ReadLine());
  14.             uint godina = uint.Parse(Console.ReadLine());
  15.             //while (godina<1801|| godina > 1900) {  godina = uint.Parse(Console.ReadLine()); }
  16.             uint count = 18u;
  17.             for (uint i = 1800; i<= godina; i++)
  18.             {              
  19.                 if (i % 2 == 0)
  20.                 {
  21.                     ost -= 12000;
  22.                 }
  23.                 else
  24.                 {                  
  25.                     ost -= (12000 + 50 * (decimal)count);
  26.                     //Console.WriteLine(count);
  27.                     //Console.WriteLine((decimal)count);
  28.                 }
  29.                 count++;
  30.             }
  31.             if (ost < 0)
  32.             {
  33.                 Console.WriteLine("He will need {0:F2} dollars to survive.", Math.Abs(ost));        
  34.             }
  35.             else
  36.             {
  37.                 Console.WriteLine("Yes! He will live a carefree life and will have {0:F2} dollars left.",ost);
  38.             }
  39.         }
  40.     }
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top