23 lines
543 B
Python
23 lines
543 B
Python
|
import re
|
||
|
|
||
|
def delete_second_digits(input_line):
|
||
|
regex = r'\b(\d+)\b'
|
||
|
numbers = re.findall(regex, input_line)
|
||
|
|
||
|
if len(numbers) > 1:
|
||
|
second_number = numbers[1]
|
||
|
input_line = re.sub(re.escape(second_number), '', input_line, 1)
|
||
|
|
||
|
return input_line
|
||
|
|
||
|
file_path = 'simple.in'
|
||
|
output_lines = []
|
||
|
|
||
|
with open(file_path, 'r', encoding='utf-8') as file:
|
||
|
for line in file:
|
||
|
modified_line = delete_second_digits(line)
|
||
|
output_lines.append(modified_line)
|
||
|
|
||
|
for line in output_lines:
|
||
|
print(line, end='')
|