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 x = scanner.nextLine().charAt(0),
- y = scanner.nextLine().charAt(0),
- z = scanner.nextLine().charAt(0);
- int counter = 0;
- for (int i = x; i <= y; i++) {
- for (int k = x; k <= y; k++) {
- for (int j = x; j <= y; j++) {
- if (i != z && k != z && j != z) {
- System.out.printf("%c%c%c ", i, k, j);
- counter++;
- }
- }
- }
- }
- System.out.println(counter);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement