Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
打印整数的二进制数
Stack<Integer> stack = new Stack<Integer>();
while(N > 0) {
stack.push(N % 2);
N = N / 2;
}
for(int d : stack) {
System.out.print(d);
}
System.out.println();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.