Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _06._Honey_Winter_Reserves
- {
- class Program
- {
- static void Main(string[] args)
- {
- double quantity = double.Parse(Console.ReadLine());
- String name = Console.ReadLine();
- while (name != "Winter has come")
- {
- double total = 0;
- for (int i = 1; i <= 6; i++)
- {
- double collectedHoney = double.Parse(Console.ReadLine());
- total += collectedHoney;
- }
- if (total < 0)
- {
- Console.WriteLine($"{name} was banished for gluttony");
- }
- quantity -= total;
- if (quantity <= 0)
- {
- break;
- }
- name = Console.ReadLine();
- }
- if (quantity > 0)
- {
- Console.WriteLine($"Hard Winter! Honey needed {quantity:F2}.");
- }
- else
- {
- Console.WriteLine($"Well done! Honey surplus {Math.Abs(quantity):F2}.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement