Advertisement
desislava_topuzakova

06. Triples of Latin Letters

May 27th, 2022
712
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package DataTypesVariables;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class TripletsOfLatinLetters_06 {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         int n = Integer.parseInt(scanner.nextLine());
  9.         //тройки от символи: {буква1}{буква2}{буква3}
  10.  
  11.         for (char letter1 = 'a'; letter1 < 'a' + n ; letter1++) {
  12.             for (char letter2 = 'a'; letter2 < 'a' + n; letter2++) {
  13.                 for (char letter3 = 'a'; letter3 < 'a' + n; letter3++) {
  14.                     System.out.printf("%c%c%c%n", letter1, letter2, letter3);
  15.                 }
  16.             }
  17.         }
  18.     }
  19. }
Advertisement
RAW Paste Data Copied
Advertisement