Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.Ch1_ArraysAndStrings;
- import java.util.Scanner;
- public class Pr_LetterCombo18thDec2016 {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- char firstChar = scan.nextLine().charAt(0);
- char lastChar = scan.nextLine().charAt(0);
- char ignoreChar = scan.nextLine().charAt(0);
- int count = 0;
- for (char a = firstChar; a <= lastChar; a++) {
- for (char b = firstChar; b <= lastChar; b++) {
- for (char c = firstChar; c <= lastChar; c++) {
- if (a == ignoreChar || b == ignoreChar || c == ignoreChar) {
- continue;
- }
- count++;
- System.out.printf("%c%c%c ", a, b, c);
- }
- }
- }
- System.out.printf("%d", count);
- }
- }
Add Comment
Please, Sign In to add comment