Error

#Error

输出位(最简单的情形)

#include <iostream>

using namespace std;

void display_bits(unsigned u)
{
    int t;
    for(t = 128; t >= 1; t /= 2)\
    {
        if(u&t) cout<<"1 ";
        else cout<<"0 ";
    }
    cout<<endl;
}

int main()
{
    display_bits(10);
    return 0;
}

posted on 2009-10-07 15:50 Error 阅读(139) 评论(0)  编辑 收藏 引用 所属分类: C++


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理