galinyotsev123

ProgBasicsJavaBook7.2ComplexLoop01stupid0PasswordGenerator

Jan 11th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class E01stupidPasswordGenerator {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int n = Integer.parseInt(scanner.nextLine());
  8. int l = Integer.parseInt(scanner.nextLine());
  9.  
  10. for (int first = 1; first < n; first++) {
  11. for (int second = 1; second < n; second++) {
  12. for (char third = 'a'; third < 'a' + l; third++) {
  13. for (char fourth = 'a'; fourth < 'a' +l; fourth++) {
  14. for (int fifth = Math.max(first, second) + 1; fifth <= n; fifth++) {
  15. System.out.print(String.format("%d%d%c%c%d ", first, second, third, fourth, fifth));
  16.  
  17. }
  18. }
  19. }
  20. }
  21. }
  22.  
  23.  
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment