Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05._Beehive_Defense
- {
- class Program
- {
- static void Main(string[] args)
- {
- int countBees = int.Parse(Console.ReadLine());
- int health = int.Parse(Console.ReadLine());
- int attack = int.Parse(Console.ReadLine());
- while (countBees >= 100)
- {
- countBees -= attack;
- health -= countBees * 5;
- if (health <= 0)
- {
- Console.WriteLine($"Beehive won! Bees left {countBees}.");
- break;
- }
- }
- if (health > 0)
- {
- if (countBees < 0)
- {
- countBees = 0;
- }
- Console.WriteLine($"The bear stole the honey! Bees left {countBees}.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement