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 ConsoleApp5
- {
- class Program
- {
- static void Main(string[] args)
- {
- decimal currency = decimal.Parse(Console.ReadLine());
- string inputCurrency = Console.ReadLine().ToUpper();
- string outputCurrency = Console.ReadLine().ToUpper();
- if (inputCurrency == "USD")
- {
- currency = currency * 1.79549m;
- }
- else if (inputCurrency == "EUR")
- {
- currency = currency * 1.95583m;
- }
- else if (inputCurrency == "GBP")
- {
- currency = currency * 2.53405m;
- }
- if (outputCurrency == "USD")
- {
- currency = currency / 1.79549m;
- }
- else if (outputCurrency == "EUR")
- {
- currency = currency / 1.95583m;
- }
- else if (outputCurrency == "GBP")
- {
- currency = currency / 2.53405m;
- }
- Console.WriteLine("{0} {1}", Math.Round(currency, 2), outputCurrency.ToUpper());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement