Didart

Triples Of Latin Letters 2

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