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 zadacha12
- {
- class Program
- {
- static void Main(string[] args)
- {
- var value = double.Parse(Console.ReadLine());
- var inputCurrency = Console.ReadLine();
- var outputCurrency = Console.ReadLine();
- double result = 0;
- if (inputCurrency == "USD")
- {
- if (outputCurrency == "BGN")
- {
- result = (value * 1.79549);
- }
- else if (outputCurrency == "EUR")
- {
- result = (value * 1.79549) / 1.95583;
- }
- else
- {
- result = (value * 1.79549) / 2.53405;
- }
- }
- else if (inputCurrency == "BGN")
- {
- if (outputCurrency == "EUR")
- {
- result = value / 1.95583;
- }
- else if (outputCurrency == "GBP")
- {
- result = value / 2.53405;
- }
- else
- {
- result = value * 1.79549;
- }
- }
- else if (inputCurrency == "EUR")
- {
- if (outputCurrency == "BGN")
- {
- result = (value * 1.95583) / 1.0;
- }
- else if (outputCurrency == "GBP")
- {
- result = (value * 1.95583) / 2.53405;
- }
- else
- {
- result = (value * 1.95583) / 1.79549;
- }
- }
- else if (inputCurrency == "GBP")
- {
- if (outputCurrency == "BGN")
- {
- result = value * 2.53405;
- }
- else if (outputCurrency == "USD")
- {
- result = (value * 2.53405) / 1.79549;
- }
- else
- {
- result = (value * 2.53405) / 1.95583;
- }
- }
- if (result != 0)
- {
- Console.WriteLine(Math.Round(result, 2));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement