23 lines
439 B
Go
23 lines
439 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"strconv"
|
||
|
|
||
|
"../../roman-numerals"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
arabic := []int{0, -1, 4000, 3999, 1, 2, 3, 4, 5, 6, 9, 27, 48, 59, 93, 141, 163, 402, 575, 911, 1024, 3000}
|
||
|
for i := range arabic {
|
||
|
fmt.Println(strconv.Itoa(arabic[i]) + ": ")
|
||
|
if v, err := romannumerals.ToRomanNumeral(arabic[i]); err == nil {
|
||
|
fmt.Print("-->")
|
||
|
fmt.Println(v)
|
||
|
} else {
|
||
|
fmt.Print("-->")
|
||
|
fmt.Println(err.Error())
|
||
|
}
|
||
|
}
|
||
|
}
|