Skip to content

[计算题][第二题]交换两个变量 不太对 #33

Description

@sunyazhou13
int a = 5;
int b = 10;

正解应该是

a  ^= b;
b ^= a;
a ^=b;

考察的是按位异或操作的原理

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions