2017-11-25 38 views

回答

-1

It is a hard question for the beginners 但你可以通過使用一點濃度來解決它。 這是簡單...

  1. 閱讀從第一個字母,並丟棄它,如果堆疊中只有一個字母,然後檢查它必須是a其他前進。
  2. 讀取所有字符串並將其放入1堆棧中。
  3. 從1堆棧中彈出信件並丟棄它。
  4. 彈出所有的字母,並推送它在2堆棧中的所有字母。
  5. 重複第2步與2堆棧。

If you pop a letter from a stack and it is一個and both stacks are empty then the string is accepted.

It is a solution of the above question, Sorry for writing.

編碼愉快。