题目:

题解:
type MyStack struct {
    queue []int
}
/** Initialize your data structure here. */
func Constructor() (s MyStack) {
    return
}
/** Push element x onto stack. */
func (s *MyStack) Push(x int) {
    n := len(s.queue)
    s.queue = append(s.queue, x)
    for ; n > 0; n-- {
        s.queue = append(s.queue, s.queue[0])
        s.queue = s.queue[1:]
    }
}
/** Removes the element on top of the stack and returns that element. */
func (s *MyStack) Pop() int {
    v := s.queue[0]
    s.queue = s.queue[1:]
    return v
}
/** Get the top element. */
func (s *MyStack) Top() int {
    return s.queue[0]
}
/** Returns whether the stack is empty. */
func (s *MyStack) Empty() bool {
    return len(s.queue) == 0
}

















![[激光原理与应用-102]:南京科耐激光-激光焊接-焊中检测-智能制程监测系统IPM介绍 - 6 - 激光焊接系统的组成](https://i-blog.csdnimg.cn/direct/de88ab345368489c87e2394e64a9b89e.png)
