Runtime Error

SeanYi Reply 7 years 10 weeks ago
안녕하세요. 문제를 풀었을 때 딱히 문제는 없는 듯한데, 계속 Runtime Error가 뜹니다. 다음은 제가 작성한 코드입니다: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); double radius = input.nextDouble(); Scanner input2 = new Scanner(System.in); double length = input2.nextDouble(); while ((radius > 1000) || (radius < 1)) { input = new Scanner(System.in); radius = input.nextDouble(); } while ((length > 1000) || (length < 1)) { input2 = new Scanner(System.in); length = input2.nextDouble(); } double area = (radius * radius) * 3.14159; double volume = area * length; System.out.printf("%.1f\n", area); System.out.printf("%.1f\n", volume); } }
onacloud Reply 7 years 10 weeks ago
버림을 하지 않으셨어요.