Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class LettersCombinations {
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8.  
  9. char fromSymbol = scanner.nextLine().charAt(0);
  10. char toSymbol = scanner.nextLine().charAt(0);
  11. char toIgnore = scanner.nextLine().charAt(0);
  12.  
  13. int counter = 0;
  14.  
  15. for (int i = fromSymbol; i < toSymbol; i++){
  16. for (int j = fromSymbol; j < toSymbol; j++){
  17. for (int k = fromSymbol; k < toSymbol; k++){
  18. if (k != toIgnore && i != toIgnore && j != toIgnore){
  19. System.out.print("" + i + j + k + " ");
  20. counter++;
  21. }
  22. }
  23. }
  24. }
  25.  
  26. System.out.println(counter);
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement