Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] WEEK4 boj1769 질문드립니다. #57

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

CSyebin
Copy link
Contributor

@CSyebin CSyebin commented Nov 6, 2021

반례를 못 찾아 코드 수정에 어려움을 겪고 있습니다.

자릿수 조건 및 한 자리 자연수의 경우는 이미 처리하였습니다.

  • 처음에 자릿수 조건을 잘못 보고 int 형으로 시도하였다가, 이후 string으로 처리하는 방법으로 바꿨습니다.
  • 한 자리 자연수를 입력 받는 경우 3의 배수인 경우 0 YES, 아닌 경우 0 NO 정상적으로 출력됨을 확인하였습니다.

@C-limlim
Copy link
Contributor

안녕하세요.
n <10일때는 함수 is3의 if(n<10)에 걸려서 1 또는 0을 리턴하는 것으로 보입니다.
그런데 n >= 10 일 때 while문에 걸려 %10을 하며 다시 is3(temp)를 실행하긴 하지만, 결국 메인함수의 isMultiplieof3으로 넘어가는 값은 -1처럼 보입니다.
두자리수의 경우에 디버깅을 해보시면서 재귀함수를 다시 보시면 좋을 것 같습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants