Didart

Triples of Latin Letters

Sep 25th, 2021
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 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 firstSymbol = 'a'; firstSymbol < 'a' + n; firstSymbol++) {
  10.             for (int secondSymbol = 'a'; secondSymbol < 'a' + n; secondSymbol++) {
  11.                 for (int thirdSymbol = 'a'; thirdSymbol < 'a' + n; thirdSymbol++) {
  12.                     System.out.printf("%c%c%c%n", firstSymbol, secondSymbol, thirdSymbol);
  13.                 }
  14.             }
  15.         }
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment