鱼C论坛's Archiver
论坛
›
新手乐园
› 输入整数二进制输出
Draem
发表于 2021-2-18 22:30:26
输入整数二进制输出
#include<stdio.h>
void main(){
printf("input a number to change into bin:");
int num,tem,count=0;
scanf("%i",&num);
int num1=num;
while(num){
tem=num%2;
num/=2;
}
while(count)printf("%d",tem[--count]);
printf("\n");
}
页:
[1]
查看完整版本:
输入整数二进制输出