python,不会,各位大佬教一下

P1046 [NOIP2005 普及组] 陶陶摘苹果

XUESIRUI12345 @ 2024-12-01 19:18:47

拜托拜托


by litangzheng @ 2024-12-01 19:22:30

@XUESIRUI12345多练


by XUESIRUI12345 @ 2024-12-01 19:31:12

不会,帮个忙


by qse_5858 @ 2024-12-01 22:54:25

@XUESIRUI12345

python:(我没测试,不行告诉我?)

h=30#凳子的高度
ls=[int(i) for i in input().split()]#输入
th=int(input())#陶陶伸手时的高度
cnt=0#计数器
for i in ls:
    if h+th>=i:
        cnt+=1
#遍历列表,一个个比较
print(cnt)#输出

by qse_5858 @ 2024-12-01 22:55:09

@XUESIRUI12345 求关


by qse_5858 @ 2024-12-01 22:57:56

@XUESIRUI12345

您是问这个吗?感觉我回复的不太对......


by XUESIRUI12345 @ 2024-12-08 18:55:19

没事,太谢谢了,麻烦了,嘿嘿 谢谢


by qse_5858 @ 2024-12-08 22:11:02

@XUESIRUI12345

没事没事,客气啥


|