代码如下:
#include <iostream>
using namespace std;
int CheckComplement()
{
union
{
unsigned int ui;
signed int si;
}uComplementChecker;
uComplementChecker.si = -1;
unsigned int ui = ~0;
return (uComplementChecker.ui == ui) ? 2 : 1;
}