Advertisement
Guest User

Untitled

a guest
Apr 4th, 2018
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.03 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4.  
  5. public class mainche {
  6.     public static void main(String[] args) throws IOException {
  7.  
  8.         BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  9.         StringBuilder sb = new StringBuilder("");
  10.  
  11.         char start = reader.readLine().charAt(0);
  12.         char end = reader.readLine().charAt(0);
  13.         char skip = reader.readLine().charAt(0);
  14.         int count = 0;
  15.  
  16.         for (char first = start; first <= end; first++) {
  17.             for (char second = start; second <= end; second++) {
  18.                 for (char third = start; third <= end; third++) {
  19.                     if (first != skip && second != skip && third != skip) {
  20.                         sb.append(first).append(second).append(third).append(" ");
  21.                         count++;
  22.                     }
  23.                 }
  24.             }
  25.         }
  26.         System.out.print(sb.toString());
  27.         System.out.printf("%d", count);
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement