Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class BeerKegs {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int lines = Integer.parseInt(scanner.nextLine());
- int biggestKeg = 0;
- String modelBig = "";
- for (int i = 0; i < lines; i++) {
- String model = scanner.nextLine();
- double radius = Double.parseDouble(scanner.nextLine());
- int height = Integer.parseInt(scanner.nextLine());
- int volume = (int) (Math.pow(radius, 2) * Math.PI * height);
- if (biggestKeg <= volume) {
- biggestKeg = volume;
- modelBig = model;
- }
- }
- System.out.println(modelBig);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement