⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpptemplate.cpp

📁 整数内码的显示方法
💻 CPP
字号:
//=====================================
// title: 整数内码
// author: cjj
// date: 2007-10-09
/* Description: 

*/
//=====================================
#include <iostream>
using namespace std;

int main()
{
	//for循环读入
	//for循环移位
	//对当前位进行输出(从高到低)
	//输出回车
	for (int n; cin >> n;)
	{
		for (int i = 31; i >= 0; i--)
		{
			//输出当前那个位上的数,0或者1
			cout << (n & (1 << i) ? 1 : 0);
		}
		cout << "  " << n << endl;
	}
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -