Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine()),
- l = Integer.parseInt(scanner.nextLine());
- for (int a = 1; a <= n; a++) {
- for (int b = 1; b <= n; b++) {
- for (int c = 97; c < 97 + l; c++) {
- for (int d = 97; d < 97 + l; d++) {
- for (int e = Math.max(a, b) + 1; e <= n; e++) {
- System.out.printf("%d%d%c%c%d ", a, b, c, d, e);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement