精華區beta Marginalman 關於我們 聯絡資訊
前幾天看C考題看到一模一樣的 一行解決 非常好布林 231. Power of Two class Solution { public: bool isPowerOfTwo(int n) { return n>0 && (n & n-1)==0; } }; -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.113.0.229 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1708340512.A.BB7.html
JIWP: 考題分一下 02/19 19:08
oin1104: 我這題是算他有幾個1 好像有點爛 02/19 19:09