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