Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package P09;
- import java.util.Scanner;
- public class E11_Snowballs {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- int N = Integer.parseInt(in.nextLine());
- double snowballValue = 0;
- int snowballSnowWin = 0;
- int snowballTimeWin = 0;
- int snowballQualityWin = 0;
- for (int i = 1; i <= N ; i++) {
- int snowballSnow = Integer.parseInt(in.nextLine());
- int snowballTime = Integer.parseInt(in.nextLine());
- int snowballQuality = Integer.parseInt(in.nextLine());
- double snowballValueCurrent = Math.pow((snowballSnow / snowballTime) , snowballQuality);
- if(snowballValueCurrent>=snowballValue){
- snowballValue = snowballValueCurrent;
- snowballSnowWin = snowballSnow ;
- snowballTimeWin = snowballTime;
- snowballQualityWin = snowballQuality;
- }
- }
- System.out.printf("%d : %d = %.0f (%d)",
- snowballSnowWin,
- snowballTimeWin,
- snowballValue,
- snowballQualityWin
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement