Homework: Převody čísel do desitkové soustavy

I pulled my eyes out just trying to think how the hell to convert
n base to decimal, then I FINALLY remembered 1984:

1 = 1000 = 1 * 10^3
9 =  900 = 9 * 10^2
8 =   80 = 8 * 10^1
4 =    4 = 4 * 10^0

So f**king simple when you eventually get it.