Advertisement
Sim0o0na

Untitled

Dec 17th, 2016
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. double n = double.Parse(Console.ReadLine());
  2.             string vhod = Console.ReadLine();
  3.             string izhod = Console.ReadLine();
  4.  
  5.             var BGN = 1;
  6.             var USD = 1.79549;
  7.             var EUR = 1.95583;
  8.             var GBP = 2.53405;
  9.             if (vhod == "USD" && izhod == "BGN")
  10.             {
  11.                 Console.WriteLine("{0:f2}", n * USD);
  12.             }
  13.             else if (vhod == "BGN" && izhod == "EUR")
  14.             {
  15.                 Console.WriteLine("{0:f2}", n / EUR);
  16.             }
  17.             else if (vhod == "EUR" && izhod == "GBP")
  18.             {
  19.                 Console.WriteLine("{0:f2}", (n* EUR) / GBP);
  20.             }
  21.             else if (vhod == "USD" && izhod == "EUR")
  22.             {
  23.                 Console.WriteLine("{0:f2}", (n * USD) / EUR);
  24.             }
  25.             else if (vhod == "GBP" && izhod == "USD")
  26.             {
  27.                 Console.WriteLine("{0:f2}", (n * GBP) / USD);
  28.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement