//十进制转换n进制,n<10
public class Transfer10to5 {
private static Stack<Integer> stack = new Stack<>();
public static Stack<Integer> transfer(int num){
if(num < 5){
stack.push(num);
return stack;
}else{
int z = num / 5;
int y = num % 5;
stack.push(y);
return transfer(z);
}
}
public static void main(String[] args) {
Iterator<Integer> integers = transfer(101).iterator();
while (integers.hasNext()){
System.out.print(integers.next());
}
}
}