SHARE
TWEET

Untitled

a guest Jan 24th, 2020 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace exercise
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.             int n = int.Parse(Console.ReadLine());
  11.             double sum = 0;
  12.             double sum2 = 0;
  13.             string currentWinner = "";
  14.             for (int i = 0; i < n; i++)
  15.             {
  16.                 string model = Console.ReadLine();
  17.                 float radius = float.Parse(Console.ReadLine());
  18.                 int height = int.Parse(Console.ReadLine());
  19.                 sum = Math.PI * Math.Pow(radius, 2) * height;
  20.                
  21.                 if (sum >= sum2)
  22.                 {
  23.                     currentWinner = model;
  24.                 }
  25.                 sum2 = sum;
  26.             }
  27.             Console.WriteLine(currentWinner);
  28.  
  29.         }
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top