05. Puppy Care C# някой може ли да намери грешката
using System;
namespace TakeCareOfAPuppy
{
class Program
{
static void Main(string[] args)
{
int purchasedAmount = int.Parse(Console.ReadLine()); // Purchased amount of puppy food
int totalFoodEaten = 0;
string input = Console.ReadLine(); // Amount of food eaten at each meal
while (input != "Adopted")
{
int foodEaten = int.Parse(input);
totalFoodEaten += foodEaten;
input = Console.ReadLine();
}
int remainingFood = purchasedAmount * 1000 - totalFoodEaten;
if (remainingFood >= 0)
{
Console.WriteLine($"Food is enough! Leftovers: {remainingFood} grams.");
}
else
{
Console.WriteLine($"Food is not enough. You need {Math.Abs(remainingFood)} grams more.");
}
}
}
}