标签:
public class SimpleTest { @Test public void test(){ //方法一 System.out.println(Integer.toBinaryString(50)); //方法二 StringBuilder sb = new StringBuilder(); int b = 50; for(int n = b;n > 0;n = (n/2)){ int r = n % 2; sb.append(r); } System.out.println(sb.reverse()); } }
标签:
原文地址:http://www.cnblogs.com/programmer1/p/5901373.html