You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
packagemain.java.com.poogle.BOJ.Q17478;
importjava.util.Scanner;
publicclassMain {
publicstaticvoidmain(String[] args) {
Scannersc = newScanner(System.in);
intn = sc.nextInt();
System.out.println("어느 한 컴퓨터공학과 학생이 유명한 교수님을 찾아가 물었다.");
calculate(n);
}
staticStringc = "";
privatestaticvoidcalculate(intn) {
StringunderBar = c;
if (n == 0) {
System.out.println(underBar + "\"재귀함수가 뭔가요?\"");
System.out.println(underBar + "\"재귀함수는 자기 자신을 호출하는 함수라네\"");
System.out.println(underBar + "라고 답변하였지.");
return;
}
System.out.println(underBar + "\"재귀함수가 뭔가요?\"");
System.out.println(underBar + "\"잘 들어보게. 옛날옛날 한 산 꼭대기에 이세상 모든 지식을 통달한 선인이 있었어.");
System.out.println(underBar + "마을 사람들은 모두 그 선인에게 수많은 질문을 했고, 모두 지혜롭게 대답해 주었지.");
System.out.println(underBar + "그의 답은 대부분 옳았다고 하네. 그런데 어느 날, 그 선인에게 한 선비가 찾아와서 물었어.\"");
c += "____";
calculate(n - 1);
System.out.println(underBar + "라고 답변하였지.");
}
}
The text was updated successfully, but these errors were encountered:
문제
핵심 아이디어
어려운 점, 실수
풀이
The text was updated successfully, but these errors were encountered: