Домашно 14 Задача - Конзолен Междувалутен Конвертор - Programming 101 / Simple Calculations
Кодът ми е:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mejdunaroden_konvertor
{
class Program
{
static void Main(string[] args)
{
double a = double.Parse(Console.ReadLine());
var first = Console.ReadLine();
var second = Console.ReadLine();
if (first == "USD")
{
if (second == "BGN")
{
Console.WriteLine( Math.Round(a * 1.79549, 2));
}
else if (second == "EUR")
{
Console.WriteLine( Math.Round(a * 0.91801, 2));
}
else if (second == "GDP")
{
Console.WriteLine( Math.Round(a * 0.70854, 2));
}
}
if (first == "BGN")
{
if (second == "USD")
{
Console.WriteLine( Math.Round(a / 1.79549, 2));
}
else if (second == "EUR")
{
Console.WriteLine( Math.Round(a / 1.95583, 2));
}
else if (second == "GBP")
{
Console.WriteLine( Math.Round(a / 2.53405, 2));
}
}
if (first == "EUR")
{
if (second == "BGN")
{
Console.WriteLine( Math.Round(a * 2.53405, 2));
}
else if (second == "USD")
{
Console.WriteLine( Math.Round(a * 1.08930, 2));
}
else if (second == "GDP")
{
Console.WriteLine( Math.Round(a * 0.77181, 2));
}
}
if (first == "GBP")
if (second == "BGN")
{
Console.WriteLine( Math.Round(a * 0.39462, 2));
}
else if (second == "USD")
{
Console.WriteLine( Math.Round(a* 2.53405 / 1.79549, 2));
}
else if (second == "EUR")
{
Console.WriteLine( Math.Round(a * 0.77181, 2));
}
}
}
}
Но ми показва 80/100.
https://judge.softuni.bg/Contests/Practice/Index/610#4