RosettaCodeData/Task/Range-extraction/00DESCRIPTION

17 lines
595 B
Text
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
{{:Range extraction/Format}}
2016-12-05 22:15:40 +01:00
;Task:
2013-04-10 23:57:08 -07:00
* Create a function that takes a list of integers in increasing order and returns a correctly formatted string in the range format.
2019-09-12 10:33:56 -07:00
* Use the function to compute and print the range formatted version of the following ordered list of integers. (The correct answer is: <code>0-2,4,6-8,11,12,14-25,27-33,35-39</code>).
2016-12-05 22:15:40 +01:00
<br>
2013-04-10 23:57:08 -07:00
0, 1, 2, 4, 6, 7, 8, 11, 12, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 27, 28, 29, 30, 31, 32, 33, 35, 36,
37, 38, 39
* Show the output of your program.
2016-12-05 22:15:40 +01:00
;Related task:
* &nbsp; [[Range expansion]]
<br><br>