Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CinemaTicket_08 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int number = Integer.parseInt(scanner.nextLine());
- double biggestVolume = Double.MIN_VALUE;
- String biggestModel = "";
- for (int i = 0; i < number; i++) {
- String Model = scanner.nextLine();
- double Radius = Double.parseDouble(scanner.nextLine());
- int Height = Integer.parseInt(scanner.nextLine());
- double Volume = Math.PI * Math.pow(Radius, 2) * Height;
- if(Volume> biggestVolume){
- biggestVolume=Volume;
- biggestModel=Model;
- }
- }
- System.out.println(biggestModel);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment