HDU 2051 Bitset
来源:互联网 发布:网络摄像机ip修改器 编辑:程序博客网 时间:2024/06/08 14:04
/*
中文题意:
中文翻译:给你一个十进制数,让你输出二进制数
题目大意:
解题思路:按照一般的方法写即可
难点详解:
关键点:进制转换
解题人:lingnichong
解题时间:2014/07/31 19:23:17
解题感受:要看懂题意,一开始看到测试数据就知道二进制转换,但不放心,还是认真看了一下。
*/
Bitset
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 12425 Accepted Submission(s): 9562
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>int a[110];int main(){int n,i,j;while(scanf("%d",&n)!=EOF){j=0;while(n){a[j++]=n%2;n/=2;}for(i=j-1;i>=0;i--)printf("%d",a[i]);printf("\n");}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
- C++ Exception handling(异常处理) part1
- 用Java实现对文件夹的操作
- spring源码之spring启动二
- Android音频系统之音频框架
- 【最小生成树之prim算法】POJ 2031---Building a Space Station
- HDU 2051 Bitset
- Cocos2dx 3.1.1 之 plist制作动画
- HDU 4901(杭电多校训练#3 1005题)The Romantic Hero(DP)
- POJ 3211 Washing Clothes
- HDU 2520 我是菜鸟,我怕谁
- 指针函数&内存分配 C
- ZOJ 3195 Design the city
- Mina 源码学习 -- 总纲
- opencv学习笔记(三)