Anonymous user
Convert seconds to compound duration: Difference between revisions
Convert seconds to compound duration (view source)
Revision as of 15:31, 25 October 2015
, 8 years agoAdded Befunge example.
(Added Befunge example.) |
|||
Line 212:
</pre>
=={{header|Befunge}}==
The value to convert is read from stdin, and the corresponding compound duration is written to stdout.
<lang befunge>&>:"<"%\"O{rq"**+\"<"/:"<"%\"r<|":*+*5-\v
v-7*"l~"/7\"d"\%7:/*83\+*:"xD"\%*83:/"<"<
> \:! #v_v#-#<",",#$48*#<,#<.#<>#_:"~"%,v
^_@#:$$< > .02g92p ^ ^!:/"~"<</lang>
{{out}}
<pre>7259
2 hr, 59 sec
86400
1 d
6000000
9 wk, 6 d, 10 hr, 40 min</pre>
=={{header|C}}==
|