
사진을 보시면 한 줄씩 밀려 입력 되었는데 선생님께서 남겨주신 정답코드를 입력해서 넣어 봐도 아래 캡처사진과 같이 똑같이나옵니다
그래서 저는 아래와 같은 값을 추가해서 넣었더니 정상으로 출력값이 나왔습니다.
제가 봤을 때 잘못쓴 코드는 없는것 같은데 아래 캡처사진과 같이 나온 이유가 뭘까요..? ㅠ
String recipe = sc.nextLine();

작성한 코드 및 에러 메세지
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String cook = sc.nextLine();
double cookStar = sc.nextDouble();
String recipe1 = sc.nextLine();
String recipe2 = sc.nextLine();
String recipe3 = sc.nextLine();
String recipe4 = sc.nextLine();
String recipe5 = sc.nextLine();
String recipe6 = sc.nextLine();
String recipe7 = sc.nextLine();
String recipe8 = sc.nextLine();
String recipe9 = sc.nextLine();
String recipe10 = sc.nextLine();
System.out.println("["+ cook + "]");
double cookPersent = ((int)cookStar * 100) / 5 ;
System.out.println("별점:" + (int)cookStar + "(" + cookPersent + "%)");
System.out.println("1." + recipe1);
System.out.println("2." + recipe2);
System.out.println("3." + recipe3);
System.out.println("4." + recipe4);
System.out.println("5." + recipe5);
System.out.println("6." + recipe6);
System.out.println("7." + recipe7);
System.out.println("8." + recipe8);
System.out.println("9." + recipe9);
System.out.println("10." + recipe10);
}
}
