Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class mainche {
- public static void main(String[] args) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- StringBuilder sb = new StringBuilder("");
- char start = reader.readLine().charAt(0);
- char end = reader.readLine().charAt(0);
- char skip = reader.readLine().charAt(0);
- int count = 0;
- for (char first = start; first <= end; first++) {
- for (char second = start; second <= end; second++) {
- for (char third = start; third <= end; third++) {
- if (first != skip && second != skip && third != skip) {
- sb.append(first).append(second).append(third).append(" ");
- count++;
- }
- }
- }
- }
- System.out.print(sb.toString());
- System.out.printf("%d", count);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement