add Variant0.java for lab3

This commit is contained in:
Oleksii Aleshchenko 2023-05-04 15:59:21 +03:00
parent bfdfd65153
commit f7b11d9444
2 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,5 @@
package lab3;
public class Lab3 {
private static final int REPETITION_NUMBER = 10;
public static void main(String[] args) {

18
src/lab3/Variant0.java Normal file
View File

@ -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("++++++++++++");
}
}