Advertisement
LOH_DIMI3

08.BeerKegs

Jan 24th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Moving
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int count = int.Parse(Console.ReadLine());
  10.  
  11.             double maxValue = double.MinValue;
  12.             string bigModel = "";
  13.  
  14.             for (int i = 0; i < count; i++)
  15.             {
  16.                 string model = Console.ReadLine();
  17.                 double radius = double.Parse(Console.ReadLine());
  18.                 int height = int.Parse(Console.ReadLine());
  19.                 double volume = Math.PI * (radius * radius) * height;
  20.                 if (volume > maxValue)
  21.                 {
  22.                     maxValue = volume;
  23.                     bigModel = model;
  24.                 }
  25.             }
  26.             Console.WriteLine(bigModel);
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement