galinyotsev123

ProgBasics07Nested-Loops-Y10passwordGenerator

Jan 9th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Y10passwordGenerator {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int n = Integer.parseInt(scanner.nextLine());
  7. int l = Integer.parseInt(scanner.nextLine());
  8. for (int i = 1; i <= n; i++) {
  9. for (int j = 1; j <= n; j++) {
  10. for (char k = 'a'; k < l + 97; k++) {
  11. for (char m = 'a'; m < l + 97; m++) {
  12. for (int last = 1; last <= n; last++) {
  13. if ((last > j) && (last > i)) {
  14. System.out.print("" + i + j + k + m + last + " ");
  15. }
  16. }
  17. }
  18. }
  19. }
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment