Advertisement
Guest User

Untitled

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