⚲
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 (485 Bytes)
Files
» erfencaozhao.py
UserName LastName
, 03/28/2025 10:55 AM
def
erfenchaozhao
(
n
,
shu
):
head
=
0
tail
=
len
(
n
)
-
1
while
head
<=
tail
:
mid
=
(
head
+
tail
)
//
2
caishu
=
n
[
mid
]
if
shu
==
caishu
:
return
mid
elif
shu
>
caishu
:
head
=
mid
+
1
elif
shu
<
caishu
:
tail
=
mid
-
1
return
False
num
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
]
shui
=
int
(
input
(
"请输入一个数:"
))
if
erfenchaozhao
(
num
,
shui
):
print
(
f
"
{
shui
}
在这个列表中"
)
else
:
print
(
f
"
{
shui
}
不在这个列表中"
)
« Previous
1
…
339
340
341
342
343
…
437
Next »
(341-341/437)
Loading...