From bfdfd651531702450f086dbd3eb749d8f2c89254 Mon Sep 17 00:00:00 2001 From: Oleksii Aleshchenko Date: Thu, 4 May 2023 15:29:07 +0300 Subject: [PATCH 1/2] add text for regex search --- test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..a9cae51 --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +Фів фіке фівлоафждіо хщшіоекдодлфіідваол фі From f7b11d94447c3425487126949ff4b9439da04c9b Mon Sep 17 00:00:00 2001 From: Oleksii Aleshchenko Date: Thu, 4 May 2023 15:59:21 +0300 Subject: [PATCH 2/2] add Variant0.java for lab3 --- src/{ => lab3}/Lab3.java | 2 ++ src/lab3/Variant0.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) rename src/{ => lab3}/Lab3.java (99%) create mode 100644 src/lab3/Variant0.java diff --git a/src/Lab3.java b/src/lab3/Lab3.java similarity index 99% rename from src/Lab3.java rename to src/lab3/Lab3.java index 06a3881..ff9d4e4 100644 --- a/src/Lab3.java +++ b/src/lab3/Lab3.java @@ -1,3 +1,5 @@ +package lab3; + public class Lab3 { private static final int REPETITION_NUMBER = 10; public static void main(String[] args) { diff --git a/src/lab3/Variant0.java b/src/lab3/Variant0.java new file mode 100644 index 0000000..647adb7 --- /dev/null +++ b/src/lab3/Variant0.java @@ -0,0 +1,18 @@ +package lab3; + +import java.util.Arrays; + +/** + * Знайти найбільшу кількість речень заданого тексту, в яких є однакові слова. + */ +public class Variant0 { + public static void main(String[] args) { + String textString = "A, a. B a. B a. B a. C."; + final String[] sentencesStrings = textString.split("\\. ?"); + for (String sentencesString : sentencesStrings) { + System.out.println(sentencesString); + } +// System.out.println(Arrays.toString(sentencesStrings)); + System.out.println("++++++++++++"); + } +}