11.Snowballs
Чупи ми го на осмия (8) тест. Идеи?
Чупи ми го на осмия (8) тест. Идеи?
java
package Fundamentals; import java.util.Scanner; public class Snowballs_11 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); // int snowball = Integer.parseInt(scanner.nextLine());//брой double snowballValue = 0; int snowbllSnow1 = 0; int snowbllTime1 = 0; int snowbllQuality1 = 0; for (int ball = 1; ball <= snowball; ball++) { int snowballSnow = Integer.parseInt(scanner.nextLine());//снежна int snowballTime = Integer.parseInt(scanner.nextLine());//време int snowballQuality = Integer.parseInt(scanner.nextLine());//качество double result = Math.pow(snowballSnow * 1.0 / snowballTime, snowballQuality); if (result > snowballValue) { snowballValue = result; snowbllSnow1 = snowballSnow; snowbllTime1 = snowballTime; snowbllQuality1 = snowballQuality; } } System.out.printf("%d : %d = %.0f (%d)",snowbllSnow1,snowbllTime1,snowballValue,snowbllQuality1); } }
Благодаря, Малин.