Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01._Guinea_Pig
- {
- internal class Program
- {
- static void Main()
- {
- double food = 1000 * double.Parse(Console.ReadLine());
- double hay = 1000 * double.Parse(Console.ReadLine());
- double cover = 1000 * double.Parse(Console.ReadLine());
- double weight = 1000 * double.Parse(Console.ReadLine());
- bool isHaveAll = true;
- weight /= 3;
- for (int i = 1; i <= 30; i++)
- {
- food -= 300;
- if (i % 2 == 0)
- {
- hay -= food * 0.05;
- }
- if (i % 3 == 0)
- {
- cover -= weight;
- }
- if (cover <= 0 || hay <= 0 || food <= 0)
- {
- isHaveAll = false;
- break;
- }
- }
- food /= 1000;
- hay /= 1000;
- cover /= 1000;
- if (isHaveAll)
- {
- Console.WriteLine($"Everything is fine! Puppy is happy! Food: {food:f2}, Hay: {hay:f2}, Cover: {cover:f2}.");
- }
- if (!isHaveAll)
- {
- Console.WriteLine("Merry must go to the pet store!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement