题目
public class Main {public static String con01(int x,int n) {StringBuffer s = new StringBuffer();while(x!=0) {s.append(x%n);x/=n;}return s.reverse().toString();}public static int con02(int x,int n) {StringBuffer s = new StringBuffer();int sum = 0;while(x!=0) {s.append(x%n);sum++;x/=n;}return sum;}public static void main(String[] args) { //System.out.println(con01(10000,2));System.out.println(con02(10000,2));}
}