bin2bcd bcd2bin

Posted by: 邱小新 at 下午4:49 in
int bin2bcd (int x) { return (x%10) | ((x/10) << 4); } int bcd2bin (int x) { return (x >> 4) * 10 + (x & 0x0f); }

0 意見

張貼留言