02-1
This commit is contained in:
18
01/01-1.py
Normal file
18
01/01-1.py
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
input_file = open("input-org", "r")
|
||||
|
||||
summe = 0
|
||||
for line in input_file:
|
||||
v1, v2 = "", ""
|
||||
line = line.strip()
|
||||
for b in line:
|
||||
if b.isdigit() and v1 == "":
|
||||
v1 = b
|
||||
if b.isdigit() and v1 != "":
|
||||
v2 = b
|
||||
summe += int(v1+v2)
|
||||
|
||||
input_file.close()
|
||||
print(summe)
|
||||
Reference in New Issue
Block a user