北邮新OJ95
来源:互联网 发布:网络诈骗 编辑:程序博客网 时间:2024/06/05 22:44
http://code.bupt.edu.cn/problem/p/95/
#include<iostream>#include<stdio.h>#include<stdlib.h>using namespace std; int main(){ int num[1001]; int n; int a[1001]; while(scanf("%d",&n)!=EOF) { for(int i=1;i<=n;i++) cin>>num[i]; for(int i=1;i<=n;i++) { if(num[i]==0) cout<<"0"<<endl; else { int temp=num[i]; int k=0; while(temp!=0) { a[k++]=temp%2; temp=temp/2; } for(int i=k-1;i>=0;i--) cout<<a[i]; cout<<endl; } } } //system("pause"); return 0;}
0 0
- 北邮新OJ95
- BUPT OJ95 二进制数
- 平方和与立方和 oj95
- 北邮新OJ87
- 北邮新OJ88
- 北邮新OJ89
- 北邮新OJ90
- 北邮新OJ91
- 北邮新OJ92
- 北邮新OJ93
- 北邮新OJ94
- 北邮新OJ96
- 北邮新OJ97
- 北邮新OJ98
- 北邮新OJ99
- 北邮新OJ100
- 北邮新OJ101
- 北邮新OJ103
- 每日一编C-6
- MSSQL与UNIX时间戳
- JAVA开发者最常去的20个英文网站
- Python编写的DHT的搜索引擎(测试)
- LeetCode || Maximum Subarray
- 北邮新OJ95
- 在deepin下安装manual文档
- android中string.xml中%1$s、%1$d等的用法
- LeetCode || Remove Element
- LeetCode || Integer to Roman
- MySQL远程访问权限,允许远程连接的开启
- sgddruh
- 李开复:算法的力量
- 黑马程序员_类加载器