Advertisement
veronikaaa86

MagicNums

Jan 29th, 2018
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Demo2 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         char first = scanner.nextLine().charAt(0);
  8.         char second = scanner.nextLine().charAt(0);
  9.         char third = scanner.nextLine().charAt(0);
  10.  
  11.         for (int i = first; i <= second; i++) {
  12.             for (int j = first; j <= second; j++) {
  13.                 for (int k = first; k <= second; k++) {
  14.                     if (i == third || j == third || k == third) {
  15.                         continue;
  16.                     } else {
  17.                         System.out.printf("%c%c%c ", i, j, k);
  18.                     }
  19.                 }
  20.             }
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement