HDU 2051 Bitset
来源:互联网 发布:淘宝运营正确思路流程 编辑:程序博客网 时间:2024/05/22 12:48
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2051
Bitset
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 13647 Accepted Submission(s): 10422
Problem Description
Give you a number on base ten,you should output it on base two.(0 < n < 1000)
Input
For each case there is a postive number n on base ten, end of file.
Output
For each case output a number on base two.
Sample Input
123
Sample Output
11011
#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<iostream>#include<algorithm>#include<sstream>#include<vector>#include<map>#include<stack>#include<list>#include<set>#include<queue>#define LL long long#define lson l,m,rt<<1#define rson m+1,r,rt<<1 | 1using namespace std;const int maxn=1005,maxe=100005,inf=1<<29;int n,m;void ToBin(){ int a[maxn],p=0; while(n) a[p++]=n%2,n/=2; while(p) printf("%d",a[--p]); printf("\n");}int main(){ while(~scanf("%d",&n)) { ToBin(); } return 0;}
0 0
- Hdu 2051 - Bitset
- HDU 2051 Bitset
- HDU 2051 - Bitset
- HDU 2051 Bitset
- HDU 2051 Bitset
- hdu 2051 Bitset(水题)
- HDU 2051 Bitset
- HDU 2051 Bitset
- Bitset HDU 2051
- HDU 2051 Bitset
- HDU 2051 Bitset
- hdu 2051 Bitset
- hdu 2051 Bitset
- HDU-2051(bitset)
- hdu 2051 Bitset
- hdu 2051 Bitset (java)
- HDU ACM 11 2051 Bitset
- hdu-Bitset
- Ubuntu下Apache SSL的简洁配置方法(HTTPS的实现)
- Where is the way to 5G wireless?
- Struts2—Action
- uva 401 Palindromes
- JavaScript闭包及实现循环绑定事件
- HDU 2051 Bitset
- java语言代理模式
- LEETCODE: Divide Two Integers
- 如何查看当前Ubuntu的版本
- HDU 2057 A + B Again
- Error:Failed to find: com.android.support:support-v4:20.+ 之类的错误解决方案
- 日志-14-12-14
- linux下syslog使用说明
- 倍战捶豆言唇汉匾嗽稳痪嚷贝杏痪