Teo_Yanchev

BeersKegs - C# - Fundamentals

Aug 19th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. using System;
  2. using System.Security.Cryptography;
  3.  
  4. namespace _08.BeerKegs
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. int n = int.Parse(Console.ReadLine());
  11.  
  12. float maxKegValue = float.MinValue;
  13. string biggestKegName = string.Empty;
  14. for (int i = 0; i < n; i++)
  15. {
  16. string modelName = Console.ReadLine();
  17. float radius = float.Parse(Console.ReadLine());
  18. int height = int.Parse(Console.ReadLine());
  19.  
  20. float biggestKegValue = (float)(Math.PI * Math.Pow(radius, 2) * height);
  21.  
  22. if (biggestKegValue > maxKegValue)
  23. {
  24. maxKegValue = biggestKegValue;
  25. biggestKegName = modelName;
  26. }
  27. }
  28. Console.WriteLine(biggestKegName);
  29.  
  30.  
  31.  
  32. }
  33. }
  34. }
  35.  
Add Comment
Please, Sign In to add comment