Programming Basics Online Exam - 7 January 2018-06. Juice Diet
Здравейте! Какво пропускам тук? Къде греша? Моля за помощ! :))) Дава ми 50/100
import java.util.Scanner; public class JuiceDiet06 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int r = Integer.parseInt(scanner.nextLine()); int s = Integer.parseInt(scanner.nextLine()); int c = Integer.parseInt(scanner.nextLine()); int juiceMax = Integer.parseInt(scanner.nextLine()); for (int i = 0; i <= r; i++) { for (int j = 0; j <= s; j++) { for (int k = 0; k <= c; k++) { double juiceCurrent = i * 4.5 + j * 7.5 + k * 15; if (juiceCurrent == juiceMax - 1 || juiceCurrent == juiceMax) { System.out.printf("%s Raspberries, %s Strawberries, %s Cherries. Juice: %.0f ml.", i, j, k, juiceCurrent); return; } } } } } }