2024-09-22 18:53:13 +00:00
|
|
|
package roman
|
|
|
|
|
2024-09-22 18:54:22 +00:00
|
|
|
import "strings"
|
|
|
|
|
2024-09-22 18:53:13 +00:00
|
|
|
func ConvertToRoman(arabic int) string {
|
2024-09-22 18:54:22 +00:00
|
|
|
var converted strings.Builder
|
2024-09-22 18:53:13 +00:00
|
|
|
if arabic <= 3 {
|
|
|
|
for i := 0; i < arabic; i++ {
|
2024-09-22 18:54:22 +00:00
|
|
|
converted.WriteString("I")
|
2024-09-22 18:53:13 +00:00
|
|
|
}
|
|
|
|
}
|
2024-09-22 18:54:22 +00:00
|
|
|
return converted.String()
|
2024-09-22 18:53:13 +00:00
|
|
|
}
|