Advertisement
Dilyana86

Untitled

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