文章

4

粉丝

495

获赞

1

访问

35.0k

头像
思路比较直
P1380 北京邮电大学机试题
发布于2020年5月6日 15:46
阅读数 9.7k

#include<stdio.h>

int main(){
	int a,b,pos;
	while(scanf("%d",&a)!=EOF){
		pos=1,b=0;
		while(a!=0){
			if(a%2==1)
				b+=pos;
			pos*=10;
			a/=2;
		}
		printf("%d\n",b);
	}
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发