refactor: add/refactor method in include, simplified print code (#471)

This commit is contained in:
hpstory
2023-04-21 14:59:22 +08:00
committed by GitHub
parent 9c2e5e2831
commit 9eeefff447
24 changed files with 102 additions and 109 deletions

View File

@ -75,7 +75,7 @@ public class array_stack
stack.push(2);
stack.push(5);
stack.push(4);
Console.WriteLine("栈 stack = " + String.Join(",", stack.toArray()));
Console.WriteLine("栈 stack = " + string.Join(",", stack.toArray()));
/* 访问栈顶元素 */
int peek = stack.peek();
@ -83,7 +83,7 @@ public class array_stack
/* 元素出栈 */
int pop = stack.pop();
Console.WriteLine("出栈元素 pop = " + pop + ",出栈后 stack = " + String.Join(",", stack.toArray()));
Console.WriteLine("出栈元素 pop = " + pop + ",出栈后 stack = " + string.Join(",", stack.toArray()));
/* 获取栈的长度 */
int size = stack.size();