Travelling - Nested loops
Здравейте, давами 90/100 с Runtime error и не мога да си открия грешката.
using System;
namespace Travelling
{
class Program
{
static void Main(string[] args)
{
string destination = Console.ReadLine();
double budget = double.Parse(Console.ReadLine());
double allMoney = 0.0;
while (destination != "End")
{
while (allMoney < budget)
{
double money = double.Parse(Console.ReadLine());
allMoney += money;
}
if (allMoney >= budget)
{
Console.WriteLine($"Going to {destination}!");
allMoney = 0.0;
}
destination = Console.ReadLine();
if (destination == "End")
{
break;
}
else
{
budget = double.Parse(Console.ReadLine());
}
}
}
}
}