03. Vacation C# 88/100 judge
Не разбирам къде е грешката, ако някой може да помогне.
using System;
public class Program
{
public static void Main()
{
double neededMoney = double.Parse(Console.ReadLine());
double ownedMoney =double.Parse(Console.ReadLine());
int daysCounter= 0;
int spendCounter = 0;
while(ownedMoney < neededMoney && spendCounter < 5)
{
string command =Console.ReadLine();
double money = double.Parse(Console.ReadLine());
daysCounter++;
if(command == "spend")
{
spendCounter++;
ownedMoney -= money;
if(ownedMoney - money < 0)
{
ownedMoney = 0;
}
}
if(command == "save")
{
spendCounter--;
ownedMoney += money;
}
}
if(spendCounter==5)
{
Console.WriteLine("You can't save the money.");
Console.WriteLine(daysCounter);
}
if(ownedMoney >= neededMoney)
{
Console.WriteLine($"You saved the money for {daysCounter} days.");
}
}
}