Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CareOfPuppy
- {
- class Program
- {
- static void Main(string[] args)
- {
- int food = int.Parse(Console.ReadLine()) * 1000;
- string foodPerDay = Console.ReadLine();
- while (foodPerDay != "Adopted")
- {
- food -= int.Parse(foodPerDay);
- foodPerDay = Console.ReadLine();
- }
- if (food >= 0)
- {
- Console.WriteLine($"Food is enough! Leftovers: {food} grams.");
- }
- else
- {
- Console.WriteLine($"Food is not enough. You need {Math.Abs(food)} grams more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement