From 85d7420722417d0114da0912c48fa280b4cce358 Mon Sep 17 00:00:00 2001 From: s450026 Date: Sun, 22 Nov 2020 19:24:16 +0100 Subject: [PATCH] Zadanie C18 --- TaskC18/C18.py | 13 +++++++++++++ TaskC18/Makefile | 0 TaskC18/run | 2 ++ 3 files changed, 15 insertions(+) create mode 100644 TaskC18/C18.py create mode 100644 TaskC18/Makefile create mode 100755 TaskC18/run diff --git a/TaskC18/C18.py b/TaskC18/C18.py new file mode 100644 index 0000000..f9fd1d2 --- /dev/null +++ b/TaskC18/C18.py @@ -0,0 +1,13 @@ +import re +import sys + + +def line_contains(line): + return re.match("(^(Mt ([1-9]|[1][0-9]|[2][0-8])))?(^(Mk ([1-9]|[1][0-6])))?(^(Łk ([1-9]|[1][0-9]|[2][0-4])))?(^(J ([1-9]|[1][0-9]|[2][0-2])))?(\, [1-9]?[0-9])", line) + + +for line in sys.stdin: + if line_contains(line): + print("yes") + else: + print("no") diff --git a/TaskC18/Makefile b/TaskC18/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/TaskC18/run b/TaskC18/run new file mode 100755 index 0000000..961a51a --- /dev/null +++ b/TaskC18/run @@ -0,0 +1,2 @@ +#!/bin/bash +python3 TaskC18/C18.py "$@" \ No newline at end of file