package com.javarush.task.pro.task05.task0508; import java.util.Scanner; /* Удаляем одинаковые строки */ public class Solution { public static String[] strings; public static void main(String[] args) { Scanner console = new Scanner(System.in); strings = new String[10]; for (int i = 0; i < 10; i++) { strings[i] = console.nextLine(); } for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { if (i != j) { if ((strings[i] != null) && (strings[j] != null)){ if (strings[i].equals(strings[j])){ strings[i] = null; strings[j] = null; } } } } } for (int i = 0; i < strings.length; i++) { System.out.print(strings[i] + ", "); } } }