Skip to content

Commit

Permalink
bu task3
Browse files Browse the repository at this point in the history
  • Loading branch information
Javohir004 committed Apr 24, 2024
1 parent 50c3ae3 commit f81a717
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 32 deletions.
Binary file removed out/production/B30_Javohir_Sharifjonov_2/Main.class
Binary file not shown.
5 changes: 0 additions & 5 deletions src/Main.java

This file was deleted.

29 changes: 29 additions & 0 deletions src/Task3.java
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);
}
}
27 changes: 0 additions & 27 deletions src/Text.txt

This file was deleted.

0 comments on commit f81a717

Please sign in to comment.