Created
April 3, 2016 14:51
-
-
Save stlevkov/cc117348f9091307405eac9011e54bf3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace USDtoBGN | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
double num = double.Parse(Console.ReadLine()); | |
var first = Console.ReadLine(); | |
var second = Console.ReadLine(); | |
if (first == "usd") | |
{ | |
if (second == "bgn") | |
{ | |
Console.WriteLine("{0} BGN", Math.Round(num * 1.79549, 2)); | |
} | |
else if (second == "eur") | |
{ | |
Console.WriteLine("{0} EUR", Math.Round(num * 0.91801, 2)); | |
} | |
else if (second == "gbp") | |
{ | |
Console.WriteLine("{0} GBP", Math.Round(num * 0.70854, 2)); | |
} | |
} | |
if (first == "bgn") | |
{ | |
if (second == "usd") | |
{ | |
Console.WriteLine("{0} USD", Math.Round(num / 1.79549, 2)); | |
} | |
else if (second == "eur") | |
{ | |
Console.WriteLine("{0} EUR", Math.Round(num / 1.95583, 2)); | |
} | |
else if (second == "gbp") | |
{ | |
Console.WriteLine("{0} GBP", Math.Round(num / 2.53405, 2)); | |
} | |
} | |
if (first == "eur") | |
{ | |
if (second == "bgn") | |
{ | |
Console.WriteLine("{0} BGN", Math.Round(num * 2.53405, 2)); | |
} | |
else if (second == "usd") | |
{ | |
Console.WriteLine("{0} USD", Math.Round(num * 1.08930, 2)); | |
} | |
else if (second == "gbp") | |
{ | |
Console.WriteLine("{0} GBP", Math.Round(num * 0.77181, 2)); | |
} | |
} | |
if (first == "gbp") | |
if (second == "bgn") | |
{ | |
Console.WriteLine("{0} BGN", Math.Round(num * 0.39462, 2)); | |
} | |
else if (second == "usd") | |
{ | |
Console.WriteLine("{0} USD", Math.Round(num * 0.70854, 2)); | |
} | |
else if (second == "eur") | |
{ | |
Console.WriteLine("{0} EUR", Math.Round(num * 0.77181, 2)); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment