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

PROGRAMMING:Binary search method

Luz5年前 (2021-05-10)题库500
Use dichotomy to find the key value in an ordered sequence {1,2,3,4,5,6,7,8,9,10}. If the key is found, output its corresponding subscript in the array, otherwise output not found.
###Input format:
Directly enter a positive integer key to find. There are no additional characters.
###Output format:
If it is found, the corresponding subscript in the array will be output in the format of "Weizhi: subscript" in one line, otherwise not found will be output.
###Input example:
```in
four
```
###Output example:
```out
weizhi:3
```
###Input example:
```
fifteen
```
###Output example:
```
not found
```






answer:If there is no answer, please comment