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 Currency_Converter
- {
- class Program
- {
- static void Main(string[] args)
- {
- var num = double.Parse(Console.ReadLine());
- string a = " BGN";
- var inCurrency = Console.ReadLine();
- var outCurrency = Console.ReadLine();
- if (inCurrency == "USD")
- { num *= 1.79549; }
- else if (inCurrency == "EUR")
- { num *= 1.95583; }
- else if (inCurrency == "GBP")
- { num *= 2.53405; }
- if (outCurrency == "USD")
- { num /= 1.79549;
- a =" USD"; }
- else if (outCurrency == "EUR")
- { num /= 1.95583;
- a = " EUR";
- }
- else if (outCurrency == "GBP")
- { num /= 2.53405;
- a = " GBP";
- }
- Console.Write(Math.Round (num, 2));
- Console.WriteLine(a);
- // Console.WriteLine(Math.Round (num,2)+ "" + outCurrency);
- // Console.WriteLine(Math.Round (num + " " + outCurrency);
- }
- }
- }
- /*
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Currency_Converter
- {
- class Program
- {
- static void Main(string[] args)
- {
- var num = double.Parse(Console.ReadLine());
- var inCurrency = Console.ReadLine();
- var outCurrency = Console.ReadLine();
- if (inCurrency == "USD")
- { num *= 1.79549; }
- else if (inCurrency == "EUR")
- { num *= 1.95583; }
- else if (inCurrency == "GBP")
- { num *= 2.53405; }
- if (outCurrency == "USD")
- { num /= 1.79549; }
- else if (outCurrency == "EUR")
- { num /= 1.95583; }
- else if (outCurrency == "GBP")
- { num /= 2.53405; }
- Console.WriteLine(Math.Round(num, 2));
- }
- }
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment