Delete lab3 directory
This commit is contained in:
parent
3bbb7c8e54
commit
6fc3cc244e
|
@ -1,8 +0,0 @@
|
||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
|
@ -1 +0,0 @@
|
||||||
Main.java
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="openjdk-19" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/OperationsStrings.iml" filepath="$PROJECT_DIR$/OperationsStrings.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
Binary file not shown.
|
@ -1,25 +0,0 @@
|
||||||
import java.util.HashSet;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
String inputText = "Who are you? What is your name? Where are you from?";
|
|
||||||
int targetLength = 3;
|
|
||||||
|
|
||||||
try {
|
|
||||||
HashSet<String> uniqueWords = new HashSet<String>();
|
|
||||||
String[] sentences = inputText.split("[?]");
|
|
||||||
for (String sentence : sentences) {
|
|
||||||
String[] words = sentence.trim().split("\\s+");
|
|
||||||
for (String word : words) {
|
|
||||||
if (word.length() == targetLength) {
|
|
||||||
uniqueWords.add(word.toLowerCase());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
System.out.println("Unique words of length " + targetLength + " in the input text are: " + uniqueWords);
|
|
||||||
} catch (Exception e) {
|
|
||||||
System.out.println("An error occurred: " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
BIN
lab3/lab3.pdf
BIN
lab3/lab3.pdf
Binary file not shown.
Loading…
Reference in New Issue