两道题解法都不太一样,可以来看看我的C++code,https://blog.csdn.net/qq_22522375/article/details/107771758