Toy Store гърми
Кода ми работи а пък ми дава 60/100?
import java.util.Scanner; public class ToyShop { public static void main(String[] args) { Scanner scan = new Scanner(System.in); double ekskurzia = Double.parseDouble(scan.nextLine()); int pyzeli = Integer.parseInt(scan.nextLine()); int kukli = Integer.parseInt(scan.nextLine()); int mecheta = Integer.parseInt(scan.nextLine()); int minioni = Integer.parseInt(scan.nextLine()); int kamioni = Integer.parseInt(scan.nextLine()); double suma = (pyzeli * 2.60) + (kukli * 3) + (mecheta * 4.10) + (minioni * 8.20) + (kamioni * 2); int igrachki = (pyzeli + kukli + mecheta + minioni + kamioni); if (igrachki >= 50) { double discount = suma * 0.25; double cenasotstypka = suma - discount; double naem = cenasotstypka * 0.1; double pechalba = cenasotstypka - naem; if (pechalba >= ekskurzia) { double ostavat = pechalba - ekskurzia; System.out.printf("Yes! %.2f lv left.", ostavat); } } if (igrachki <= 49) { double naem2 = suma * 0.1; double pechalba2 = suma - naem2; if (pechalba2 <= ekskurzia) { double ostavat = ekskurzia - pechalba2; System.out.printf("Not enough money! " + "%.2f lv needed.", ostavat); } } } }