Advertisement
bullit3189

BeerKegs - DataTypes-TF-Jan19

Jan 30th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5.  
  6. public class Program
  7. {
  8. public static void Main()
  9. {
  10. int n = int.Parse(Console.ReadLine());
  11. string bestKeg = string.Empty;
  12. double bestVolume =0;
  13.  
  14. for (int i=0; i<n; i++)
  15. {
  16. string model = Console.ReadLine();
  17. double radius = double.Parse(Console.ReadLine());
  18. int height = int.Parse(Console.ReadLine());
  19.  
  20. double currVol = Math.PI * (radius*radius) * height;
  21.  
  22. if (currVol>bestVolume)
  23. {
  24. bestKeg = model;
  25. bestVolume = currVol;
  26. }
  27. }
  28. Console.WriteLine(bestKeg);
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement