Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Command: dc -fdc-p2.dc <input
- 0 Sa # bottom sentinel of stack a
- # Read Input
- ?
- [
- # stack: item2 item1
- d;b 1+ r:b # b(item2)++
- Sa # push item1 on stack a
- ? z0<I
- ] dsIx
- # Process
- 0La # sum
- [
- d;b *+ # sum += b(item) * item
- La d0<L
- ] dsLx
- [Part 2: ]nrp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement