Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package DataTypesVarsEx2405;
- import java.util.Scanner;
- public class Problem8beerKegs {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = scanner.nextInt();
- String biggestKegModel = "";
- for (int i = 0; i<n; i++) {
- double topVolume = 0;
- for (int x = 0; x<3; x++) {
- String currentModel = scanner.nextLine();
- double currentRadius = Double.parseDouble(scanner.nextLine());
- int height = scanner.nextInt();
- double currentVolume = Math.PI*Math.pow(currentRadius, 2)*height;
- if (currentVolume>topVolume) {
- biggestKegModel=currentModel;
- }
- }
- }
- System.out.println(biggestKegModel);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement