Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- public class Program
- {
- public static void Main()
- {
- Dictionary<string, decimal> currency = new Dictionary<string,decimal>
- {
- {"bgn",1M },
- { "usd",1.79549M},
- {"eur",1.95583M},
- {"gbp",2.53405M}
- };
- decimal price = decimal.Parse(Console.ReadLine());
- string input = Console.ReadLine();
- string output = Console.ReadLine();
- decimal outputCurrency=currency[output];
- decimal valueInput = price * currency[input];
- decimal valueOutput = (valueInput /outputCurrency );
- Console.WriteLine("{0:f2}",valueOutput);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement