diff --git a/TaskA37/run b/TaskA37/run index afa66c0..273ba7a 100644 --- a/TaskA37/run +++ b/TaskA37/run @@ -1,2 +1,2 @@ #!/bin/bash -python TaskA29/run.py "$@" +python TaskA37/run.py "$@" diff --git a/TaskA47/run b/TaskA47/run new file mode 100644 index 0000000..a181a53 --- /dev/null +++ b/TaskA47/run @@ -0,0 +1,2 @@ +#!/bin/bash +python TaskA47/run.py "$@" diff --git a/TaskA47/run.py b/TaskA47/run.py new file mode 100644 index 0000000..339c04e --- /dev/null +++ b/TaskA47/run.py @@ -0,0 +1,17 @@ +import sys +import re + +regex = re.compile('(#[A-Za-z][A-Za-z0-9]*)') + +for line in sys.stdin: + hashtags = list(regex.findall(line.replace('\n', ''))) + if hashtags: + answer = '' + for i, tag in enumerate(hashtags): + if i == 0: + answer += tag + else: + answer += ';' + tag + print(answer) + else: + print('')