Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- double money = double.Parse(Console.ReadLine());
- string firstCurrency = Console.ReadLine();
- string secondCurrency = Console.ReadLine();
- double USD = 1.79549;
- double EUR = 1.95583;
- double GBR = 2.53405;
- double total = 0;
- if (firstCurrency == "BGN")
- {
- total = money;
- if (secondCurrency == "USD")
- {
- total = money / USD;
- }
- else if (secondCurrency == "GBP")
- {
- total = money / GBR;
- }
- else if (secondCurrency == "EUR")
- {
- total = money / EUR;
- }
- }
- else if (firstCurrency == "USD")
- {
- total = money;
- if (secondCurrency == "BGN")
- {
- total = money * USD;
- }
- else if (secondCurrency == "EUR")
- {
- total = money * USD / EUR;
- }
- else if (secondCurrency == "GBP")
- {
- total = money * USD / GBR;
- }
- }
- else if (firstCurrency == "EUR")
- {
- total = money;
- if (secondCurrency == "BGN")
- {
- total = money * EUR;
- }
- else if (secondCurrency == "USD")
- {
- total = money * EUR / USD;
- }
- else if (secondCurrency == "GBP")
- {
- total = money * EUR / GBR;
- }
- }
- else if (firstCurrency == "GBP")
- {
- total = money;
- if (secondCurrency == "BGN")
- {
- total = money * GBR;
- }
- else if (secondCurrency == "USD")
- {
- total = money * GBR / USD;
- }
- else if (secondCurrency == "EUR")
- {
- total = money * GBR / EUR;
- }
- }
- Console.WriteLine($"{total:F2} {secondCurrency}");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement