Задача Moving
Отново Compile time error.Моля за малко помощ.Благодаря предварително
Ето го и кода:
import java.util.Scanner;
public class Moving {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int width = Integer.parseInt(scanner.nextLine());
//TODO: Read the length and height
int volume = width * length * height;
boolean hasVolume = true;
String command = scanner.nextLine();
while (!command.equals("Done"))
{
int box = Integer.parseInt(command);
volume -= box;
if (volume < 0) {
hasVolume = false;
break;
}
command = scanner.nextLine();
}
if (hasVolume)
System.out.printf("%d Cubic meters left.", volume);
else
System.out.printf("No more free space! You need %d