Задача - World Swimming Record
Здравейте.
Имам проблем със задачата - World Swimming Record
На мога да разбера защо имам 80/100. И какво не е наред.
Това ми е решението
using System;
namespace WorldRecord
{
class Program
{
static void Main(string[] args)
{
double recordseconds = double.Parse(Console.ReadLine());
double distanceinmeters = double.Parse(Console.ReadLine());
double timeforonemeter = double.Parse(Console.ReadLine());
double ivantime = distanceinmeters * timeforonemeter;
double fifteen = Math.Floor(distanceinmeters / 15) * 12.5;
double ivanalltime = ivantime + fifteen;
double slowertime = ivanalltime - recordseconds;
if (ivanalltime > recordseconds)
{
/* slowertime = Math.Abs(slowertime);*/
Console.WriteLine("No, he failed! He was " + "{0:f2}" + " seconds slower.", slowertime);
}
else if (ivanalltime < recordseconds)
{
Console.WriteLine("Yes, he succeeded! The new world record is " + "{0:f2}" + " seconds.", ivanalltime);
}
}
}
}
Благодаря.