desislava_topuzakova

06. Triples of Latin Letters

May 29th, 2021
1,491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class elevator {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int n = Integer.parseInt(scanner.nextLine());
  7.  
  8.         for (char letter1 = 'a' ; letter1 < 'a' + n ; letter1++) {
  9.             for (char letter2 = 'a'; letter2 < 'a' + n; letter2++) {
  10.                 for (char letter3 = 'a'; letter3 < 'a' + n; letter3++) {
  11.                     System.out.printf("%c%c%c%n",letter1, letter2,  letter3);
  12.                 }
  13.             }
  14.         }
  15.  
  16.  
  17.  
  18.  
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment