Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- namespace exampreparation
- {
- class exam
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- double bestFormula = 0;
- string bestKeg = string.Empty;
- for (int i = 0; i < n; i++)
- {
- string nameKeg = Console.ReadLine();
- double radius = double.Parse(Console.ReadLine());
- int height = int.Parse(Console.ReadLine());
- double formula = 3.14 * radius * radius * height;
- if (formula > bestFormula)
- {
- bestFormula = formula;
- bestKeg = nameKeg;
- }
- }
- Console.WriteLine(bestKeg);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement