Advertisement
4valeri

Impress_the_girlfriend

Feb 17th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.94 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. namespace Problem_1___Impress_the_girlfriend
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             decimal r = decimal.Parse(Console.ReadLine());
  14.             decimal d = decimal.Parse(Console.ReadLine());
  15.             decimal e = decimal.Parse(Console.ReadLine());
  16.             decimal b = decimal.Parse(Console.ReadLine());
  17.             decimal m = decimal.Parse(Console.ReadLine());
  18.  
  19.             decimal rubles = 3.5M / 100M;
  20.             decimal dollar = 1.5M;
  21.             decimal euro = 1.95M;
  22.             decimal leva = b / 2;
  23.  
  24.             decimal rublesPrice = r * rubles;
  25.             decimal dollarPrice = d * dollar;
  26.             decimal euroPrice = e * euro;
  27.             decimal levaPrice = leva;
  28.             decimal justLeva = m;
  29.  
  30.             if (rublesPrice >= rublesPrice && rublesPrice >= dollarPrice && rublesPrice >= euroPrice && rublesPrice >= levaPrice && rublesPrice >= justLeva) Console.WriteLine("{0:f2}", Math.Ceiling(rublesPrice));
  31.             else if (dollarPrice >= rublesPrice && dollarPrice >= dollarPrice && dollarPrice >= euroPrice && dollarPrice >= levaPrice && dollarPrice >= justLeva) Console.WriteLine("{0:f2}", Math.Ceiling(dollarPrice));
  32.             else if (euroPrice >= rublesPrice && euroPrice >= dollarPrice && euroPrice >= euroPrice && euroPrice >= levaPrice && euroPrice >= justLeva) Console.WriteLine("{0:f2}", Math.Ceiling(euroPrice));
  33.             else if (levaPrice >= rublesPrice && levaPrice >= dollarPrice && levaPrice >= euroPrice && levaPrice >= levaPrice && levaPrice >= justLeva) Console.WriteLine("{0:f2}", Math.Ceiling(levaPrice));
  34.             else if (justLeva >= rublesPrice && justLeva >= dollarPrice && justLeva >= euroPrice && justLeva >= levaPrice && justLeva >= justLeva) Console.WriteLine("{0:f2}", Math.Ceiling(justLeva));
  35.  
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement