Buenas,
El problema es que el nextInt() lee el numero y se deja el salto de linea (\n) y cuando haces el nextLine() siguiente interpreta este salto de linea como el input.
Yo en tu lugar utilizaria siempre el nextLine() para la entrada de datos. En tu caso bastaria con hacer:
dato = Integer.parseInt(input.nextLine());
Código Java:
Ver originalpackage calcu;
import java.util.*;
public class Calcu {
int dato;
boolean hubo =false;
Scanner input
= new Scanner
(System.
in); System.
out.
println("Quiere ingresar algo?"); resp = input.nextLine();
while (resp.equals("S")){
hubo = true;
System.
out.
println("Ingrese un dato"); dato
= Integer.
parseInt(input.
nextLine()); if (dato > max) {
max = dato;
}
System.
out.
println("mas datos?"); resp = input.nextLine();
}
if (hubo) {
System.
out.
println("Maximo vale" + max
);
} else {
System.
out.
println("No hubo datos"); }
input.close();
}
}
Un saludo