The symbol range

Report a typo

You get a symbol as input. You need to tell which ranges contain the given symbol: Latin, Greek, Egyptian or other?

You can find the needed ranges in the official documentation.

Sample Input 1:

77836

Sample Output 1:

Egyptian

Sample Input 2:

7526

Sample Output 2:

Greek

Sample Input 3:

1040

Sample Output 3:

other
Write a program in Go
package main

import (
"fmt"
"unicode"
)

func main() {
var symbol rune
fmt.Scan(&symbol)

switch {
case unicode.In(symbol, unicode.Latin):
fmt.Println("Latin")
case unicode.In(symbol, ?):
fmt.Println("Greek")
// write the cases for the `Egyptian_Hieroglyphs` and `other` symbols below:
case unicode.In(symbol, ?):
fmt.Println("?")
default:
fmt.Println("?")
}

}
___

Create a free account to access the full topic