-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50c3ae3
commit f81a717
Showing
4 changed files
with
29 additions
and
32 deletions.
There are no files selected for viewing
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import java.util.ArrayList; | ||
import java.util.Objects; | ||
|
||
public class Task3 { | ||
public static void main(String[] args) { | ||
ArrayList<String>list = new ArrayList<>(); | ||
list.add("cd"); | ||
list.add("ac"); | ||
list.add("dc"); | ||
list.add("zz"); | ||
list.add("ca"); | ||
list.add("zz"); | ||
task3(list); | ||
} | ||
|
||
private static void task3(ArrayList<String> list) { | ||
int sanoq=0; | ||
for (int i = 0; i < list.size(); i++) { | ||
String word = String.valueOf( new StringBuilder(list.get(i)).reverse()); | ||
for (int j = i+1; j < list.size(); j++) { | ||
if(word.equals(list.get(j)) ){ | ||
System.out.println(++sanoq); | ||
break; | ||
} | ||
} | ||
} | ||
System.out.println("Javob : " + sanoq); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.