文章目录
- Apples Plus
- 找最小值
- 分类平均
- 一尺之棰
Apples Plus
L = int(input())
for i in range(1,L + 1):if i == 1:print(f'Today, I ate 1 apple.')else:print(f'Today, I ate {i} apples.')
找最小值
a = int(input())
b = list(map(int,input().split()))
print(min(b))
分类平均
n,k = list(map(int,input().split()))
A = []
B = []
for i in range(1,n + 1):if i % k == 0:A.append(i)else:B.append(i)
print(round(sum(A) / len(A),1),round(sum(B) / len(B),1))
一尺之棰
a = int(input())
count = 1
while a != 1:a //= 2count += 1
print(count)