Advertisement
desislava_topuzakova

06. Triples of Latin Letters

Jan 23rd, 2021
847
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class TriplesOfLatinLetters_06 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         //s1, s2, s3 -> s1s2s3
  8.         int n = Integer.parseInt(scanner.nextLine());
  9.  
  10.         for (char symbol1 = 'a'; symbol1 < 'a' + n ; symbol1++) {
  11.             for (char symbol2 = 'a'; symbol2 < 'a' + n ; symbol2++) {
  12.                 for (char symbol3 = 'a'; symbol3 < 'a' + n ; symbol3++) {
  13.                     System.out.printf("%c%c%c%n", symbol1, symbol2, symbol3);
  14.                 }
  15.             }
  16.         }
  17.  
  18.  
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement