Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- double bgnValue = 1;
- double usdValue = 1.79549;
- double eurValue = 1.95583;
- double gbpValue = 2.53405;
- double price = double.Parse(Console.ReadLine());
- var input = Console.ReadLine();
- var output = Console.ReadLine();
- double valueInput = 0;
- double valueOutput = 0;
- if (input == "bgn")
- {
- valueInput = (price * bgnValue);
- }
- if (input == "usd")
- {
- valueInput = (price * usdValue);
- }
- if (input == "eur")
- {
- valueInput = (price * eurValue);
- }
- if (input == "gbp")
- {
- valueInput = (price * gbpValue);
- }
- if (output == "bgn")
- {
- valueOutput = (valueInput / bgnValue);
- }
- if (output == "usd")
- {
- valueOutput = (valueInput / usdValue);
- }
- if (output == "eur")
- {
- valueOutput = (valueInput / eurValue);
- }
- if (output == "gbp")
- {
- valueOutput = (valueInput / gbpValue);
- }
- Console.WriteLine($"{valueOutput:F2}");
- //Курс USD EUR GBP
- // 1 BGN 1.79549 1.95583 2.53405
- //var input = Console.ReadLine();// Enter BGN, USD, EUR or GBP currency
- // var output = Console.ReadLine();// Enter BGN, USD, EUR or GBP currency
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement