Groovy web console

subscribe to the feed Subscribe
to this
site

prefixes

Published 3 months ago by Thor with tags WB
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def prefixes(int i){
    int t=0
    while(i>0){
        int r=i%10
        i=i/10
        t=t/10
        t=(10*r)+t
    }
    return t
}

a=9

println(prefixes(a))