2565_1_Sample_Quiz_1.py
WARNING
โค้ดกาวมากครับ อย่าลอกเลย 😭😭😭
ทำเองเถอะนะครับ จะได้ทำข้อสอบได้ 🥲🥲🥲
py
numbers = tuple(int(k) for k in input().split(" "))
k = int(input())
consec = 1
current = numbers[0]
sum_of_consec = 0
for i in range(1, len(numbers) + 1):
if not i >= len(numbers) and numbers[i] == current:
consec += 1
else:
if consec >= k:
sum_of_consec += current * consec
consec = 1
if i < len(numbers):
current = numbers[i]
print(sum(numbers) - sum_of_consec)
People who plagiarize Com Prog HW: | People who do Com Prog HW by themself: |
|
|
|---|

