Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace EXAM_Seize_the_Fire
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] typeFire = Console.ReadLine().Split(" = ").ToArray();
- int water = int.Parse(Console.ReadLine());
- double totalEffort = 0;
- double sumEffort = 0;
- double totalFire = 0;
- int effort = 0;
- for (int i = 0; i < typeFire.Length; i++)
- {
- string[] currFire = typeFire[i].Split('#').ToArray();
- int efforts = int.Parse(currFire[0]);
- int typeFires = int.Parse(currFire[1]);
- if (water >= efforts)
- {
- water -= effort;
- }
- else
- {
- sumEffort += effort;
- totalEffort = sumEffort * 0.25;
- Console.Write("Cells: ");
- Console.WriteLine($"- {effort}");
- Console.WriteLine($"Effort: {totalEffort:F2}");
- Console.WriteLine($"Total Fire: {sumEffort:F2}");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment