I've termed this the "alternate" pattern, since the flag alternates rows with an odd number of stars and rows with an even number of stars.
鉴于这种模式下国旗上每行五星以奇偶数目排列交替出现,我称之为“交替模式”。
T: Yes. Is it an even number or an odd number?
对。那它是偶数还是奇数。
Count the number of ones in each byte of the 8-byte block; if the number of ones is even, make it odd by setting the least significant bit to one.
统计8字节块中每字节中的1的个数,如果1的个数为偶数,那么就设置最低位为1使它成为奇数。
In either case, I take that value and multiply back by two, if it was even I get back the original number, if it was odd, I'm not going to get back the original number, so I can just check to see if they're the same.
在两种情况中,我都把结果值,再乘以2,如果x是偶数我就,得到了原来的值,如果x是奇数那么就不会得到,原来的值,因此我看看得到的值,和原来的值相等不相等就可以了。
应用推荐