Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- class Solution {
- public static void main(String args[]) {
- Scanner in = new Scanner(System.in);
- String mn = in.nextLine();
- String[] tab = {"-----", ".----", "..---", "...--","....-", ".....", "-....", "--...","---..", "----."};
- String rep = "";
- if(mn.replaceAll("[^0-9]","").length() == 10 && mn.replaceAll("[0-9]","").length() == 0)
- for(char c : mn.toCharArray())
- rep += tab[c-'0'] + " ";
- else
- rep += "Untransformable";
- System.out.print(rep.trim());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement