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