This problem is in Contest(s) below:
Contest 1370:程序设计基础上机6-函数程序设计-软工B241-242-王迪
Contest 1401:程序设计基础C上机4:函数实例操作-物工B243-B244