7

Tip #286   Addition with dc.

Add one number per line from stdin until a 0 is found, then print the result.
dc -e '[+pq]sQ0[?d0=Q+lXx]dsXx'

 
  • TAGS: