TheBulgarianWolf

Character Combinations

Apr 23rd, 2020
574
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 SoftUni {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner sc = new Scanner(System.in);
  7.         int n = Integer.parseInt(sc.nextLine());
  8.        
  9.         for(int first = 97;first < 97 + n;first++){
  10.             for(int second = 97;second < 97 + n;second++){
  11.                 for(int third = 97;third < 97 + n;third++){
  12.                    
  13.                     System.out.println((char)first + "" + (char)second + "" + (char)third);
  14.                 }
  15.             }
  16.         }
  17.        
  18.     }
  19.  
  20. }
Add Comment
Please, Sign In to add comment