ToyStore Java
Здравейте,
Задачата ToyStore работи, печати каквото трябва, но Judge казва 60/100...
Нещо пропускам - сигурен съм, че някоя къдрава скоба не си е на мястото :) Ето:
import java.util.Scanner;
public class ToyStore {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double priceecxcursion = Double.parseDouble(scanner.nextLine());
int puzz = Integer.parseInt(scanner.nextLine());
int dolls = Integer.parseInt(scanner.nextLine());
int tedybear = Integer.parseInt(scanner.nextLine());
int minions = Integer.parseInt(scanner.nextLine());
int trucks = Integer.parseInt(scanner.nextLine());
double sum = (puzz * 2.6 + dolls * 3 + tedybear * 4.10 + minions * 8.2 + trucks * 2.0);
int count = puzz + dolls + tedybear + minions + trucks;
if (count >= 50) {
double disc = sum * 0.75;
double ttlsum = disc * 0.9;
double yes = ttlsum - priceecxcursion;
System.out.printf("Yes! %.2f lv left.", yes);
}else if( count <= 50){
double ttlsum2 = sum * 0.9;
double no = priceecxcursion - ttlsum2;
System.out.printf("Not enough money! %.2f lv needed.", no);
}
}
}