Skip to main content
1 of 7
breadbox
  • 7.3k
  • 33
  • 45

C, 250 chars

b[64],a;*f(char*p,char*s){int t=0;for(;;++p)if(*p^32&&!(*p>47? printf("%*s%ld",a,"",strtol(p,&p,10)),--p:*p==40?p=f(p+1,s+t):0)){ for(a=1;t*(s[t]^43&&s[t]^45||*p^42&&*p^47);)printf(" %c",s[t--]); if(!*p||*p==41)return p;s[++t]=*p;}}main(){f(gets(b),b);} 

I can remove 12 chars if we're allowed to have a leading space in the output. Just sayin'.

breadbox
  • 7.3k
  • 33
  • 45