Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class LettersCombinations {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- char fromSymbol = scanner.nextLine().charAt(0);
- char toSymbol = scanner.nextLine().charAt(0);
- char toIgnore = scanner.nextLine().charAt(0);
- int counter = 0;
- for (int i = fromSymbol; i < toSymbol; i++){
- for (int j = fromSymbol; j < toSymbol; j++){
- for (int k = fromSymbol; k < toSymbol; k++){
- if (k != toIgnore && i != toIgnore && j != toIgnore){
- System.out.print("" + i + j + k + " ");
- counter++;
- }
- }
- }
- }
- System.out.println(counter);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement