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)
- {
- double honeyNeeded = double.Parse(Console.ReadLine());
- string command = Console.ReadLine();
- double fullHoney = 0;
- while (command != "Winter has come")
- {
- string beeName = command;
- double singleBee = 0.0;
- for (int i = 0; i < 6; i++)
- {
- double honeyGathered = double.Parse(Console.ReadLine());
- singleBee += honeyGathered;
- fullHoney += honeyGathered;
- }
- if (fullHoney >= honeyNeeded)
- {
- break;
- }
- if (singleBee < 0)
- {
- Console.WriteLine($"{beeName} was banished for gluttony");
- }
- command = Console.ReadLine();
- }
- if (fullHoney >= honeyNeeded)
- {
- Console.WriteLine($"Well done! Honey surplus {fullHoney-honeyNeeded:f2}.");
- }
- else
- {
- Console.WriteLine($"Hard Winter! Honey needed {honeyNeeded-fullHoney:F2}.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement