/
spirzen
/
it-code-examples
Обзор
Документация
Войти
/
spirzen
/
it-code-examples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/java/lab-1131-033/main.java
20 строк
546 B
Spirzen
Code migration pack
09 июн 2026, 01:41
09 июн 2026, 01:41
cebc284
Код
Авторство
О чём код?
import java.util.*; public class UniqueOrdered { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); LinkedHashSet<Integer> set = new LinkedHashSet<>(); for (int i = 0; i < n; i++) { set.add(sc.nextInt()); } boolean first = true; for (int x : set) { if (!first) System.out.print(" "); System.out.print(x); first = false; } System.out.println(); sc.close(); } }