Nested Loops Lab 6.Travelling
Visual Studio ми работи, но като пусна в judge и дава грешка със звездички:
Unhandled Exception: System.FormatException: Input string was not in a correct format. at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) at travelling.Program.Main(String[] args)
Не мога да разбера къде греша.
ето задачата:
using System;
namespace travelling
{
class Program
{
static void Main(string[] args)
{
string destination = Console.ReadLine();
double budget = double.Parse(Console.ReadLine());
double totalsaved = 0;
double moneySaved = 0;
while (destination!="End")
{
while (totalsaved < budget)
{
moneySaved = double.Parse(Console.ReadLine());
totalsaved += moneySaved;
}
Console.WriteLine($"Going to {destination}!");
destination = Console.ReadLine();
budget = double.Parse(Console.ReadLine());
totalsaved = 0;
}
}
}
}
благодаря