public F(int n) { var stack = new MyStack <int>(n); int num = n; while (stack.Count() != n) { if (num > 0) { stack.Push(num--); Console.WriteLine(stack.Peek()); } } while (!stack.IsEmpty()) { Console.WriteLine(stack.Pop().ToString()); } }
private void btnCount_Click(object sender, EventArgs e) { tbCount.Text = ms.Count().ToString(); }