Advertisement
Yanislav29

Untitled

Jan 25th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. var n = int.Parse(Console.ReadLine());
  10. string max = " ";
  11. double maxSum = double.MinValue;
  12. double sum = 0.0;
  13. double pi = Math.PI;
  14.  
  15. for (int i = 1; i <= n; i++)
  16. {
  17. string name = Console.ReadLine();
  18. var r = double.Parse(Console.ReadLine());
  19. var h = int.Parse(Console.ReadLine());
  20.  
  21. sum = pi * r * r * h;
  22. if(sum > maxSum)
  23. {
  24. maxSum = sum;
  25. max = name;
  26. }
  27.  
  28. }
  29. Console.WriteLine(max);
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement