⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
document
All Projects
document
Overview
Activity
Issues
Spent time
Gantt
Calendar
News
Documents
Wiki
Files
Download (408 Bytes)
Files
» erfenchazhao.py
UserName LastName
, 01/17/2025 09:55 AM
def
erfenchazhao
(
n
,
shu
):
length
=
len
(
n
)
low
=
1
high
=
length
-
1
while
low
<=
high
:
mid
=
(
low
+
high
)
//
2
caishu
=
n
[
mid
]
if
shu
==
caishu
:
return
mid
elif
shu
<
caishu
:
high
=
mid
-
1
elif
shu
>
caishu
:
low
=
mid
+
1
print
(
f
"找到数
{
caishu
}
"
)
n
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
]
shu
=
int
(
input
(
"请输入数"
))
erfenchazhao
(
n
,
shu
)
« Previous
1
…
97
98
99
100
101
…
437
Next »
(99-99/437)
Loading...