2051——Bitset
来源:互联网 发布:java模块化框架 编辑:程序博客网 时间:2024/05/22 12:28
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 <stdio.h>main(){ int n; while(scanf("%d",&n)!=EOF) { int i=1; int a[10]; if(n<2) { printf("%d\n",n); continue; } while(n>=2) { a[i]=n%2; n=n/2; i++; } a[i]=n; while(i) { printf("%d",a[i]); i--; } printf("\n"); }}
第一次老眼昏花看成n<100,导致数组开小= =
0 0
- 2051——Bitset
- HDU——2051——Bitset
- STL——bitset
- 2051 Bitset
- 【Bitset 2051】
- Bitset 2051
- 2051 Bitset
- 2051 Bitset
- [2051]:Bitset
- 2051Bitset
- 模拟大数据处理之——bitset
- Linux下编程练习——bitset
- [bitset] POJ 2443——Set Operation
- [bitset]BZOJ 3687——简单题
- bitset+递归——幂次方
- 实现小尝试—C++ STL bitset
- bitset应用——用string数组对bitset数组赋值
- 第三章 标准库string、vector、bitset类型 —— 第三节 bitset类
- 【系统信息获取】3,注册表中的当前系统各种信息
- android控件的大小控制dimens
- 无推广无刷榜挺进苹果商店AppStore收费榜总榜排行前10!
- Myeclipse、Eclipse 如何设置单行代码显示的最大宽度
- MEncoder的基础用法—6.2. 选择输入文件或设备
- 2051——Bitset
- udacity-web development-homework(unit2 signup)
- OCP-1Z0-053-V13.02-253题
- ubuntu 安装boost
- MEncoder的基础用法—6.3. 编码为双通道MPEG-4 ("DivX")
- UML之部署图
- 怎么让多个div横向并排,前面的div都固定宽度,最后一个div自动计算宽度
- MTK60D+MT5931 调试心得
- 算法实例6