------解决方案--------------------
#include <iostream>
using namespace std;
int main()
{
const int w=8;
int x[w]={0,0,1,0,1,0,0,0};
int sum=0;
for (int i=0;i<=w-2;++i)
{
sum+=x[i]*(1<<i);
}
sum*=(x[w-1]%2==0 ? 1 : -1);//B2Sw
cout<<sum;
system("PAUSE");
return 0;
}