This problem is in Contest(s) below:
Contest 1407:程序设计基础C上机5:函数实例操作-物工B243-B244
Contest 1406:程序设计基础C上机5:函数实例操作-物工B241-B242