问题描述
- C#报错使用泛型类型的“Stack”需要1个类型的参数 和无法运用于方法组和int 操作数怎么解决
-
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>
时间: 2024-12-06 13:06:35