Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace tESt
- {
- class Program
- {
- static void Main(string[] args)
- {
- var money = double.Parse(Console.ReadLine());
- var initialCurrency = Console.ReadLine();
- var targetCurrency = Console.ReadLine();
- const double USD = 1.79549;
- const double EUR = 1.95583;
- const double GBP = 2.53405;
- if (initialCurrency == "USD")
- {
- money *= USD;
- }
- else if (initialCurrency == "EUR")
- {
- money *= EUR;
- }
- else if (initialCurrency == "GBP")
- {
- money *= GBP;
- }
- if (targetCurrency == "USD")
- {
- money /= USD;
- }
- else if (targetCurrency == "EUR")
- {
- money /= EUR;
- }
- else if (targetCurrency == "GBP")
- {
- money /= GBP;
- }
- var result = Math.Round(money, 2);
- Console.WriteLine(result + " " +targetCurrency);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment