Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace EasterBake
- {
- class Program
- {
- static void Main(string[] args)
- {
- double volume = double.Parse(Console.ReadLine());
- double sugar = double.Parse(Console.ReadLine());
- double flour = double.Parse(Console.ReadLine());
- double sugarTotal = 0;
- double flourTotal = 0;
- double maxSugar = 0;
- double maxFlour = 0;
- for (int i = 1; i <= volume ; i++)
- {
- if (maxSugar < sugar)
- {
- maxSugar = sugar;
- }
- if (maxFlour < flour)
- {
- maxFlour = flour;
- }
- sugarTotal += sugar;
- flourTotal += flour;
- if (i == volume)
- {
- break;
- }
- sugar = double.Parse(Console.ReadLine());
- flour = double.Parse(Console.ReadLine());
- }
- Console.WriteLine($"Sugar: {Math.Ceiling(sugarTotal / 950)}");
- Console.WriteLine($"Flour: {Math.Ceiling(flourTotal / 750)}");
- Console.WriteLine($"Max used flour is {maxFlour} grams, max used sugar is {maxSugar} grams.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement