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