#include <iostream> #include <stdio.h> using namespace std; int main() { char data = 0x11; //printf("%d\n", data); while ((data&0x0F) != 0x0A) { //cout << "D right:" << (data&0x0f) << endl; while ((data&0xF0) != 0xA0) { //cout << "D left:" << ((data&0xf0)>>4) << endl; if ((data&0x0F)%3 != ((data&0xF0)>>4)%3) cout << "Left:" << ((data&0xF0)>>4) << " Right:" << (data&0x0F) << endl; data += 0x10; } data = data & 0x0F; data += 0x11; } return 0; }
原文:http://blog.csdn.net/jarelzhou/article/details/18911427