Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Demo
- {
- class Demo
- {
- static void Main()
- {
- var value = decimal.Parse(Console.ReadLine());
- var firstCurrency = Console.ReadLine();
- var secondCurrency = Console.ReadLine();
- var bg = value;
- var result = 0.0m;
- if (firstCurrency == "USD")
- {
- bg = value * 1.79549m;
- }
- else if (firstCurrency == "EUR")
- {
- bg = value * 1.95583m;
- }
- else if (firstCurrency == "GBP")
- {
- bg = value * 2.53405m;
- }
- //output
- if (secondCurrency == "BGN")
- {
- result = bg;
- Console.WriteLine($"{result:f2} BGN");
- }
- else if(secondCurrency == "USD")
- {
- result = bg / 1.79549m;
- Console.WriteLine($"{result:f2} USD");
- }
- else if (secondCurrency == "EUR")
- {
- result = bg / 1.95583m;
- Console.WriteLine($"{result:f2} EUR");
- }
- else if (secondCurrency == "GBP")
- {
- result = bg / 2.53405m;
- Console.WriteLine($"{result:f2} GBP");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement