class Class1
{
static string De(int N, int D)
{
Stack stack = new Stack();
if (D < 2 || D > 16)
{
throw new ArgumentOutOfRangeException("D", "指示灯是否");
}
do
{
int residue = N % D;
char c = (residue < 10) ? (char)(residue + 48) : (char)(residue + 55);
stack.Push(c);
}
while ((N = N / D) != 0);
string s = string.Empty;
while (stack.Count > 0)
{
s += stack.Pop().Tostring();
}
return s;
}
}
Stack<int>