This problem is in Contest(s) below:
Contest 1009:1.6编程基础之一维数组(15题)
Contest 1025:C++ L3 课后练习题
Contest 1013:C++ 高级水平测试