⚲
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 (475 Bytes)
Files
» erfenchazhao.py
UserName LastName
, 01/17/2025 11:16 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
return
False
n
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
]
shu
=
int
(
input
(
"请输入数"
))
if
erfenchazhao
(
n
,
shu
):
print
(
"数在这个列表中"
)
else
:
print
(
'数不在这个列表中'
)
« Previous
1
…
117
118
119
120
121
…
437
Next »
(119-119/437)
Loading...