This problem is in Contest(s) below:
Contest 1413:第17届蓝桥杯软件赛校赛
Contest 1346:C++语言入门