a,_=gets.split("/") puts " "*5 + a[0..0]*a.count("0") puts " "+"_"*(a.size+2) puts "9 | "+a a.size.times{|n| puts (" "*(n+4))+a[0..1] puts (" "*(n+2))+"- #{"%2d"%(a[0..0].to_i*9)}" puts (" "*(n+4))+"__" } print (" "*(a.size+4))+a[0..0]
Note that non-ascii characters in the above source code will be escaped (such as \x9f).