Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Solution {
- public static void main(String[] args) {
- // The letters b and d are mirror images of each other, as are p and q. No other pairs of letters are mirrors, except for letters like H that are mirrors of themselves, and what’s the interest in a pair that’s just two of the same letter? We refuse to count self-mirrors as mirrored pairs.
- // Fr
- // qp
- // HH
- // db
- // pq
- //https://wcipeg.com/problem/a2
- Scanner sc= new Scanner(System.in);
- System.out.println("Ready");
- while (true) {
- String S = sc.nextLine(); //including space
- if (S.equals(" ") ) {
- break;
- } else if (S.equals("bd")||S.equals("db")||S.equals("pq") ||S.equals("qp")) {
- System.out.println("Mirrored pair");
- } else {
- System.out.println("Ordinary pair");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement