本程序思想:把十进制0至64转成6位的二进制输出
#include <stdio.h>
int main()
{
int w[6] = { 32,16,8,4,2,1 };//6位二进制每位的十进制含义
int B[6] = { 0 };//存放6位的二进制数
int N = 0, i = 0, Cha = 0;
while (N < 64)
{
Cha = N;
i = 0;
while (i < 6)
{
if (w[i] > Cha)
B[i] = 0;
else
{
B[i] = 1;
Cha = Cha - w[i];
&...
登录后发布评论
暂无评论,来抢沙发