package main import( "fmt" "sort" ) func heightNum(num int, heights *[]int){ for i := 1; i < num; i++{ var val int fmt.Scan(&val) *heights = append(*heights, val) } } func appendSort(height int, heightSlice *[]int){ *heightSlice = append(*heightSlice, height) sort.Ints(*heightSlice) } func ranking(i int){ if i == 1{ fmt.Printf("%dst\n", i) } else if i == 2{ fmt.Println("%dnd\n", i) } else if i == 3{ fmt.Printf("%drd\n", i) } else{ fmt.Printf("%dth\n", i) } } func main(){ var height, num int fmt.Scan(&height, &num) heightSlice := []int{} heightNum(num, &heightSlice) appendSort(height, &heightSlice) for i, v := range heightSlice{ if v == height{ ranking(len(heightSlice) - i) break } } }