Pana la urma am reusit sa gasesc ceva pe net dar nu stiu unde trebuie atasat mesajul "Imposibil". Asta este programul. public class Suma { public void subset(int[] A, int n, int m, int currLen, boolean[] used) { if (currLen == n) { for (int i = 0; i < A.length; i++) { if (used == true) { System.out.print(A + " "); } } System.out.println(); return; } if (m == A.length) { return; } used[m] = true; subset(A, n, m + 1, currLen + 1, used); used[m] = false; subset(A, n, m + 1, currLen, used); } public static void main(String[] args) { int A[] = { 1, 2, 3,4}; boolean[] B = new boolean[A.length]; Suma i = new Suma(); i.subset(A, 3, 0, 0, ; } }