#Python 3, 162 characters
Python 3, 162 characters
p=print
t=int(input())
d=4*'-'
s=' '
a='+\n'
r=(t-1)*s
p(r+' _|_|_\n'+r+'| |')
for i in range(2,t+1):b=(t-i)*s;p(b+'+-'+i*d+a+b+'| '+i*2*s+'|')
p('+-'+t*d+a)
It's not very clever, but I've never done one of these before. (Edit: removed unnecessary parentheses; reduced by one more character)