// Program 15: Remove Duplicate Array Elements In Place import java.util.*; class ArrayUnique { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] a = new int[10]; for (int i = 0; i < 10; i++) { a[i] = sc.nextInt(); } int size = 10; for (int i = 0; i < size; i++) { int j = i + 1; while (j < size) { if (a[i] == a[j]) { for (int k = j; k < size - 1; k++) { a[k] = a[k + 1]; } size--; } else { j++; } } } for (int i = 0; i < size; i++) { System.out.print(a[i] + " "); } } }