Skip to content

[백준 10869] 사칙연산 문제-변수 선언에서 질문 있습니다!! #4

Answered by ghdcksgml1
1006lem asked this question in Q&A
Discussion options

You must be logged in to vote

문제 조건을 보시면, B가 A보다 더 클 수 있습니다. 따라서 unsigned 조건을 쓰면 안된다는 사실을 알 수 있네요. Ex) A:999 , B:1000
정답: A-B = -1 short unsigned는 왜 통과되는지 모르겠습니다.. ㅋㅋㅋㅋㅋ 안되는게 맞긴한데 질문이 굉장히 예리하신것같아요.

웬만하면 int 쓰시고 범위가 넘어갈것같으면 long long 타입 쓰세요 264까지 가능

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@1006lem
Comment options

1006lem Mar 26, 2022
Collaborator Author

@ghdcksgml1
Comment options

Answer selected by 1006lem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Q&A Improvements or additions to documentation 백준 This issue or pull request already exists C++ Good for newcomers 해결!! This doesn't seem right
2 participants