-->
当前位置:首页 > 题库

PROGRAMMING:Han Soldiers

Luz5年前 (2021-05-10)题库467
In the history of Chinese mathematics, there is a widely spread story of "Han Xin ordering soldiers": Han Xin was a great general under Liu Bang, the emperor of the Han Dynasty. He was brave, good at fighting, and resourceful, and made outstanding contributions to the establishment of the Han Dynasty. It is said that Han Xin's mathematical level is also very high. When he ordered the troops, in order to know how many soldiers there were, and at the same time to keep military secrets, he asked the soldiers to queue up and report the numbers
-Report the number from 1 to 5, and note that the number reported by the last soldier is 1;
-Then report the number from 1 to 6, and record that the number reported by the last soldier is 5;
-Then report the number from 1 to 7, and record that the number reported by the last soldier is 4;
-Finally, the number from 1 to 11 is reported, and the number reported by the last soldier is 10;
Please write a program to calculate how many soldiers Han Xin has at least.
###Input format:
There is no input for this question
###Output format:
Output the number of soldiers Han Xin has at least< br>





answer:If there is no answer, please comment