Pipes in pool-помощ
Здравейте!
Някой може ли да помогне със задачата?Когато тествам решенията,резултатите са верни,но все пак според Judge решението ми е 30/100.
import java.util.Scanner; public class PipesPool { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int Volume = Integer.parseInt(scanner.nextLine()); int P1 = Integer.parseInt(scanner.nextLine()); int P2 = Integer.parseInt(scanner.nextLine()); double Hours = Double.parseDouble(scanner.nextLine()); double P1liters = Hours*P1; double P2liters = Hours*P2; double totalpipes = P1liters+P2liters; double pipespercentage = ((totalpipes*100))/1000; double pipe1percentage=((P1liters/totalpipes)*100); double pipe2percentage=((P2liters/totalpipes)*100); if(totalpipes>Volume){ double morel = totalpipes-Volume; System.out.printf("For %.2f hours the pool overflows with %.2f liters.",Hours,morel); }else{ char p = '%'; System.out.printf("The pool is %.2f%s full. Pipe 1: %.2f%s. Pipe 2: %.2f%s.",pipespercentage,p,pipe1percentage,p,pipe2percentage,p); } } }