Currency Converter
Като го тествам в Judge ми дава грешка а VS дава резултат както е в описанието. 12.35 EUR = 9.53 GBR
static void Main(string[] args)
{
double money = double.Parse(Console.ReadLine());
string firstCurrency = Console.ReadLine();
string secondCurrency = Console.ReadLine();
double USD = 1.79549;
double EUR = 1.95583;
double GBR = 2.53405;
double total = 0;
if (firstCurrency == "BGN")
{
total = money;
if (secondCurrency == "USD")
{
total = money / USD;
}
else if (secondCurrency == "GBP")
{
total = money / GBR;
}
else if (secondCurrency == "EUR")
{
total = money / EUR;
}
}
else if (firstCurrency == "USD")
{
total = money;
if (secondCurrency == "BGN")
{
total = money * USD;
}
else if (secondCurrency == "EUR")
{
total = money*USD/ EUR;
}
else if (secondCurrency == "GBR")
{
total = money*USD/ GBR;
}
}
else if (firstCurrency == "EUR")
{
total = money;
if (secondCurrency == "BGN")
{
total = money * EUR;
}
else if (secondCurrency == "USD")
{
total = money*EUR/ USD;
}
else if (secondCurrency == "GBR")
{
total = money*EUR/ GBR;
}
}
else if (firstCurrency == "GBR")
{
total = money;
if (secondCurrency == "BGN")
{
total = money * GBR;
}
else if (secondCurrency == "USD")
{
total = money*GBR/ USD;
}
else if (secondCurrency == "EUR")
{
total = money*GBR/ EUR;
}
}
Console.WriteLine($"{total:F2} {secondCurrency}");
}
}
}
Благодаря на всички за помоща.