# 月 = 日にちの総和が2015年に何日あるか import math # 変数 count = 0 month = [] # 月の情報(月、日数) january = (1, 31) february = (2, 28) march = (3, 31) april = (4, 30) may = (5, 31) june = (6, 30) july = (7, 31) august = (8, 31) september = (9, 30) october = (10, 31) november = (11, 30) december = (12, 31) month.append(january) month.append(february) month.append(march) month.append(april) month.append(may) month.append(june) month.append(july) month.append(august) month.append(september) month.append(october) month.append(november) month.append(december) # 計算(1月) for month in month: for i in range(month[1]): i += 1 # 桁分ける mae = math.floor(i / 10) usiro = i % 10 # 判定 if (mae + usiro) == month[0]: count += 1; print(count)