GithubHelp home page GithubHelp logo

Comments (1)

yusiny avatar yusiny commented on July 26, 2024

안녕하세요! 우선 너무너무 좋은 글 잘 봤습니다 ㅎㅎ
<10진수 정수를 2진수로 변환하여 출력> 부분 탈출 조건식이 이해가 가지 않아 질문 남깁니다!
if(n<2)일 때 탈출하는 것으로 조건을 짜게 되면, 2진수로 변환된 결과의 맨 앞자리 숫자가 출력되지 않는데요
그래서 저는 if(n==0), 즉 몫이 0일 때 탈출하는 것으로 조건식을 조금 바꾸었더니 정상적으로 결과가 출력되었습니다!
학교에서 2진수 변환 알고리즘을 배울 때에도 while(q!=0) 몫이 0일 때로 조건식을 설정하는 걸로 배웠구요!

n<2로 설정한 조건식이 제 컴퓨터에서만 다르게 돌아가는 건지, 혹은 작성하신 코드가 오류가 있는 건지 의문이 생겨 댓글 남깁니다!

from comments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.