# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---



# 求解[100,999]区间内个十百位相加能被8整除的数字的个数

count = 0
for num in range(100, 999+1):
    num3 = num // 100
    num2 = (num-100*num3) // 10
    num1 = (num-100*num3-10*num2)
    
    if (num1+num2+num3) % 8 == 0:
        count += 1

count









StarcoderdataJupyterScriptsDedupFiltered