prog.cpp
来自「C++ primer 4th edition 部分习题解答 前十章」· C++ 代码 · 共 24 行
CPP
24 行
#include<iostream>
#include<string>
#include<vector>
#include<bitset>
#include<math.h>
using namespace std;
int main()
{
long int num=pow(2,1)+pow(2,2)+pow(2,3)+pow(2,5)+pow(2,8)+pow(2,13)+pow(2,21);
bitset <32> first(num);
cout<<first<<endl;
bitset <32> second;
second.set(1);
second.set(2);
second.set(3);
second.set(5);
second.set(8);
second.set(13);
second.set(21);
cout<<second<<endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?