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

swap(a,b) #30

Open
Bluelich opened this issue Feb 8, 2018 · 1 comment
Open

swap(a,b) #30

Bluelich opened this issue Feb 8, 2018 · 1 comment

Comments

@Bluelich
Copy link

Bluelich commented Feb 8, 2018

https://github.com/NtZheng/NTAlgorithm/edit/master/%E4%BA%A4%E6%8D%A2%E4%B8%A4%E4%B8%AA%E6%95%B0/%E4%BA%A4%E6%8D%A2%E4%B8%A4%E4%B8%AA%E6%95%B0/main.cpp

加减法可能会导致溢出,异或或者临时变量交换相对安全些!

@NtZheng
Copy link
Owner

NtZheng commented Feb 8, 2018

我写个备注

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

No branches or pull requests

2 participants