位运算法 常用技巧 以下讨论都是从0位开始 flag = 1010001001 分别表示选与不选flag & (1<<i) 取falg中第i位的状态flag |= (1<<i) 将第i位标记为1 转载于:https://www.cnblogs.com/shawn-ji/p/5734230.html