Competitive Programming Solutions

GitHub
back to dashboard

Q. Digits

Codeforces - Sheet #2 (Loops) · limit: 1s · memory: 256MB · view on codeforces

input

4
121
39
123456
1200

output

1 2 1
9 3
6 5 4 3 2 1
0 0 2 1
Main.java
static void solve() {

        // Write your solution here
        char[] s = new StringBuilder(in.next()).reverse().toString().toCharArray();
        for(char c:s)
            out.print(c + " ");
        out.println();
    }