文章

145

粉丝

143

获赞

21

访问

37.7k

头像
二进制数 题解:递归解决
P1380 北京邮电大学机试题
发布于2024年1月27日 15:33
阅读数 449

#include <stdio.h>	

int Binary(int n)
{
	if(n >= 2)
		Binary(n/2);
	printf("%d",n%2);
}

int main()
{
	int n;
	while(scanf("%d",&n) != EOF)
	{
		Binary(n);
	}

	return 0;
}

 

登录查看完整内容


登录后发布评论

1 条评论
show_maker
2024年2月20日 20:52

用函数牛皮

赞(1)