本帖最后由 chocolate 于 2012-1-6 17:15 编辑
public class Test {
public static void main(String[] args) {
String src = System.console().readLine();
int i = Integer.parseInt(src);//This method will give the failed reason.
String aim = "";
while (i > 1) {
aim = i % 2 + aim;
i /= 2;
}
aim = i+aim;
System.out.println(aim);
}
}
|