This problem is in Contest(s) below:
Contest 1007:技能大赛训练01
Contest 1009:16计应2 C程序设计 作业