Advertisement
miroLLL

ImpressTheGirlfriend

Nov 28th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.30 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. /*
  8.     First - Russian site selling games in rubles
  9.     Second - American site selling games in dollars
  10.     Third - Official sit of the game selling games in euros
  11.     Fourth - Bulgarian site selling games in leva - B - 2 copies of the game for the price for one
  12.     Fifth - Bulgarian site selling game in leva - M
  13.  
  14.     100 rubles = 3.5 leva
  15.     1 dollar = 1.5 leva
  16.     1 euro = 1.95 leva
  17.  
  18.     if spiro buys 2 special games from B site, he always sell one of them for exactly half of the money he paid for both
  19. */
  20.  
  21. class ImpressTheGirlfriend
  22. {
  23.     static void Main()
  24.     {
  25.         uint r = uint.Parse(Console.ReadLine());
  26.         uint d = uint.Parse(Console.ReadLine());
  27.         uint e = uint.Parse(Console.ReadLine());
  28.         uint b = uint.Parse(Console.ReadLine());
  29.         uint m = uint.Parse(Console.ReadLine());
  30.  
  31.         decimal rubles = (r / 100.0M) * 3.5M;
  32.         decimal dollars = d * 1.5M;
  33.         decimal euros = e * 1.95M;
  34.         decimal bSiteInleva = b / 2;
  35.  
  36.         decimal[] allPrices = {rubles, dollars, euros, bSiteInleva, m};
  37.  
  38.         decimal mostExpensive = allPrices.Max();
  39.  
  40.  
  41.         Console.WriteLine("{0:F2}", Math.Ceiling(mostExpensive));  
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement