Решение на 08BeerKegs с Java
package Q02DataTypesAndVariables.exersize;
import java.util.Scanner;
public class P08BeerKegs {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = Integer.parseInt(scanner.nextLine());
double previousVolume = 0.0;
String biggestKeg = "";
for (int i = 0; i < n; i++) {
String keg = scanner.nextLine();
double radius = Double.parseDouble(scanner.nextLine());
int height = Integer.parseInt(scanner.nextLine());
double currentVolume = Math.PI * radius * radius * height;
if (currentVolume > previousVolume){
previousVolume = currentVolume;
biggestKeg = keg;
}
}
System.out.println(biggestKeg);
}
}