Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _08._Beer_Kegs
- {
- public class Program
- {
- public static void Main()
- {
- int counter = int.Parse(Console.ReadLine());
- double maxVolume = double.MinValue;
- string winnKegs = string.Empty;
- for (int i = 0; i < counter; i++)
- {
- string modelKegs = Console.ReadLine();
- double radius = double.Parse(Console.ReadLine());
- int height = int.Parse(Console.ReadLine());
- double volumeOfKegs = Math.PI * (Math.Pow(radius, 2)) * height ; //π * r^2 * h.
- if(maxVolume < volumeOfKegs)
- {
- maxVolume = volumeOfKegs;
- winnKegs = modelKegs;
- }
- }
- Console.WriteLine(winnKegs);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement