This problem is in Contest(s) below:
Contest 1141:基础班-排序
Contest 1163:C++程序设计习题
Contest 1003:竞赛基础题型练习