You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
447 B
20 lines
447 B
import os
|
|
|
|
dir = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
input_file = open(os.path.join(dir, './input.txt'), 'r')
|
|
lines = input_file.readlines()
|
|
|
|
new_list = []
|
|
num_lines = len(lines)
|
|
count = 0
|
|
for i in range(num_lines):
|
|
int_value = int(lines[i])
|
|
if i + 2 >= num_lines:
|
|
break
|
|
|
|
new_list.append(int(lines[i])+int(lines[i+1])+int(lines[i+2]))
|
|
if i >= 1 and new_list[i] > new_list[i-1]:
|
|
count = count+1
|
|
|
|
print(count)
|