From ef113e811dc4cbd776b3c3d7651349eb919d8ecb Mon Sep 17 00:00:00 2001 From: s473575 Date: Sun, 10 Dec 2023 19:09:40 +0100 Subject: [PATCH] ex4 --- TaskE05/run.py | 9 +++++++++ TaskE05/test.out | 11 +++++++++++ TaskE22/run.py | 9 +++++++++ TaskE22/test.out | 11 +++++++++++ TaskE39/run.py | 11 +++++++++++ TaskE39/test.out | 12 ++++++++++++ TaskE45/run.py | 15 +++++++++++++++ TaskE45/test.out | 14 ++++++++++++++ 8 files changed, 92 insertions(+) create mode 100644 TaskE05/run.py create mode 100644 TaskE05/test.out create mode 100644 TaskE22/run.py create mode 100644 TaskE22/test.out create mode 100644 TaskE39/run.py create mode 100644 TaskE39/test.out create mode 100644 TaskE45/run.py create mode 100644 TaskE45/test.out diff --git a/TaskE05/run.py b/TaskE05/run.py new file mode 100644 index 0000000..05e1401 --- /dev/null +++ b/TaskE05/run.py @@ -0,0 +1,9 @@ +import re +import sys + +for line in sys.stdin: + stripped_line = line.strip() + if re.search(r'^(PCMCIA|WYSIWYG|[A-Z]{2,5})$', stripped_line): + print('yes') + else: + print('no') \ No newline at end of file diff --git a/TaskE05/test.out b/TaskE05/test.out new file mode 100644 index 0000000..a5ff398 --- /dev/null +++ b/TaskE05/test.out @@ -0,0 +1,11 @@ +no +yes +yes +no +yes +yes +no +no +no +yes +yes diff --git a/TaskE22/run.py b/TaskE22/run.py new file mode 100644 index 0000000..ac06369 --- /dev/null +++ b/TaskE22/run.py @@ -0,0 +1,9 @@ +import re +import sys + +for line in sys.stdin: + stripped_line = line.strip() + if re.search(r'^(?:[0-9]|10):(?:[0-9]|10)$', stripped_line): + print('yes') + else: + print('no') \ No newline at end of file diff --git a/TaskE22/test.out b/TaskE22/test.out new file mode 100644 index 0000000..6872505 --- /dev/null +++ b/TaskE22/test.out @@ -0,0 +1,11 @@ +yes +yes +no +yes +no +no +no +yes +yes +no +no diff --git a/TaskE39/run.py b/TaskE39/run.py new file mode 100644 index 0000000..0e7ae06 --- /dev/null +++ b/TaskE39/run.py @@ -0,0 +1,11 @@ +import re +import sys + +for line in sys.stdin: + stripped_line = line.strip() + if re.search(r'^(?!.*0.*0.*$)[0-9]{6}$', stripped_line): + print('yes') + else: + print('no') + +# bez negacji ^(0[1-9]{5}|[1-9]0[1-9]{4}|[1-9]{2}0[1-9]{3}|[1-9]{3}0[1-9]{2}|[1-9]{4}0[1-9]{1}|[1-9]{5}0|[1-9]{6})$ \ No newline at end of file diff --git a/TaskE39/test.out b/TaskE39/test.out new file mode 100644 index 0000000..828c955 --- /dev/null +++ b/TaskE39/test.out @@ -0,0 +1,12 @@ +no +yes +no +yes +yes +yes +no +yes +yes +yes +no +no diff --git a/TaskE45/run.py b/TaskE45/run.py new file mode 100644 index 0000000..b3db766 --- /dev/null +++ b/TaskE45/run.py @@ -0,0 +1,15 @@ +import re +import sys + + + +for line in sys.stdin: + stripped_line = line.strip() + words = stripped_line.split(' ') + if (len(words) == 2) and (len(words[1]) > 1): + if re.match(r'((?!.*a$)([A-Z]|Ł)[a-ząćęłńóśźż]+|Jarema|Kosma)$', words[0]): + print(words[1]) + else: + print('') + else: + print('') \ No newline at end of file diff --git a/TaskE45/test.out b/TaskE45/test.out new file mode 100644 index 0000000..e799db6 --- /dev/null +++ b/TaskE45/test.out @@ -0,0 +1,14 @@ + + + + +Nowak +Ścież +Źdźbło + +Xa + + + + +