SeqStack* convertToType(int number, int type) {
SeqStack* stack = new SeqStack;
stack->top = -1;
while (number != 0) {
int rest = number % type;
if (stack->top < 99) {
stack->data[++stack->top] = rest;
}
else {
cout << "out of memery";
}
number = (number - rest) / type;
}
return stack;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…