第一题JAVA版 https://blog.csdn.net/weixin_43419256/article/details/108568253