Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Recursion_Sorting_and_Searching;
- import java.io.BufferedReader;
- import java.io.InputStreamReader;
- import java.util.Arrays;
- public class Vectors {
- public static void main(String[] args) {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- int[] arr = new int[9];
- Generate(0,arr);
- }
- private static void Generate(int index, int[] arr) {
- if (index == arr.length) {
- System.out.println(String.join(", ", Arrays.toString(arr)));
- } else {
- for (int i = 0; i <= 9; i++) {
- arr[index] = i;
- Generate(index + 1,arr);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment