Advertisement
Spocoman

08. Beer Kegs

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