设为首页 加入收藏

TOP

HDU 2051 Bitset
2014-11-23 21:46:31 来源: 作者: 【 】 浏览:14
Tags:HDU 2051 Bitset

Bitset
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 9931 Accepted Submission(s): 7686


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
1
2
3

Sample Output
1
10
11


import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(new BufferedInputStream(System.in));
		while(sc.hasNext()){
			int m=sc.nextInt();
			String s=Integer.toBinaryString(m);
			System.out.println(s);
		}
	}

}

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇hdu2197 下一篇[leetcode]N-Queens

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·深入理解 Java 集合 (2025-12-27 07:22:48)
·Java集合框架全面解 (2025-12-27 07:22:45)
·时隔 15 年,巨著《J (2025-12-27 07:22:43)
·定义一个类模板并实 (2025-12-27 06:52:28)
·一文搞懂怎么用C语言 (2025-12-27 06:52:25)