From 2316c1e4a714354d6f657836c7307f6ede842420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zofia=20B=C4=85czyk?= Date: Sun, 8 Nov 2020 18:19:05 +0100 Subject: [PATCH] attempt-1 --- TaskA03/Makefile | 0 TaskA03/run | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 TaskA03/Makefile create mode 100644 TaskA03/run diff --git a/TaskA03/Makefile b/TaskA03/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/TaskA03/run b/TaskA03/run new file mode 100644 index 0000000..126c08c --- /dev/null +++ b/TaskA03/run @@ -0,0 +1,16 @@ +#!/usr/bin/python3 + +import sys +def num(x): + if x >= '0' and x <= '9': + return True +def rok(line): + x = line.find('19') + while x>= 0 and x < len(line): + if num(line[x+2]) and num(line[x+3]) and line[x+4] == ' ' and line[x+5] == 'r' and line[x+6] == '.': + return print(line.rstrip('\n')) + else: + x = line.find('19', x+2) + +for line in sys.stdin: + rok(line)