摘要: 给你一个 正整数 num ,输出它的补数。补数是对该数的二进制表示取反。 直观想法,直接取反不就完事了吗 class Solution { public: int findComplement(int num) { return ~num; } }; 不对的!因为int类型的数据采用四个字节,即32 阅读全文
posted @ 2021-10-18 10:58 Maxwell'Maxwill 阅读(250) 评论(0) 推荐(0) 编辑