SAMPLE EXAM - April 2016
Имам лек проблем със Judge системата. Получавам целия output вярно. Спазил съм формата на печатане. Въпреки всичко, не мога да си взема точките.
https://judge.softuni.bg/Contests/Practice/Index/182#0 --- > Това е линкът към задачата.
Ето го и решението ми :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Names
{
class Program
{
static void Main(string[] args)
{
double usd = double.Parse(Console.ReadLine());
int usdWeight = int.Parse(Console.ReadLine());
double gbp = double.Parse(Console.ReadLine());
int gbpWeight = int.Parse(Console.ReadLine());
double cny = double.Parse(Console.ReadLine());
int cnyWeight = int.Parse(Console.ReadLine());
double USDperKG = (usd / usdWeight)/0.58;
double GBPperKG = (gbp / gbpWeight)/0.41;
double CNYperKG = (cny / cnyWeight) * 0.2700;
double lowestpriceperkg = Math.Round(Math.Min(CNYperKG, Math.Min(USDperKG, GBPperKG)), 2);
double highestpriceperkg = Math.Round(Math.Max(CNYperKG, Math.Max(USDperKG, GBPperKG)), 2);
double difference = highestpriceperkg - lowestpriceperkg;
string country;
if (lowestpriceperkg == CNYperKG)
country = "Chinese";
else if (lowestpriceperkg == USDperKG)
country = "USD";
else
country = "UK";
Console.WriteLine($"{country} store. {Math.Round(lowestpriceperkg,2)} lv/kg");
Console.WriteLine($"Difference {Math.Round(difference,2)} lv/kg");
}
}
}