243

#include <iostream>
#include <ctime>
using namespace std;
void print_binary(int v){
int size = sizeof (int) * 8;
while (size--){
if ((v & 1<<size)!=0) cout<<"1 ";
else cout<<"0 ";
}
cout<<endl;
}


int main()
{
srand(time(NULL));
int x = rand();
cout<<"x hex value->"<<x<<endl;
cout<<"orginal->binary:"; print_binary(x);
cout<<"all 1->:"; print_binary(~0 | x);
cout<<"all 0->:"; print_binary(0 & x);
cout<<"all last low 1->:"; print_binary(x | 0xff);
cout<<"all last low 0->"; print_binary(x &  ~0 - 0xff);
return 0;
}
阅读更多
文章标签: include hex null
上一篇what is mod ?
下一篇246
想对作者说点什么? 我来说一句

东芝223 243服务手册

2015年03月02日 14.11MB 下载

没有更多推荐了,返回首页

关闭
关闭