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