Range extraction: Difference between revisions
→{{header|Go}}: language change. built in error type.
(→Iterative: Insert the Iterative code specimen) |
(→{{header|Go}}: language change. built in error type.) |
||
Line 743:
import (
"fmt"
▲ "os"
"strconv"
"strings"
Line 763:
}
func rangeFormat(a []int) (string,
if len(a) == 0 {
return "", nil
Line 784:
}
if a[n2] == a[n2-1] {
return "",
"sequence repeats value %d", a[n2]))
}
if a[n2] < a[n2-1] {
return "",
"sequence not ordered: %d < %d", a[n2], a[n2-1]))
}
|