题目
HJ96 表示数字
golang实现
package mainimport ("fmt""unicode"
)func main() {s := ""var s_o stringvar char_pre, r runefor {n, _ := fmt.Scan(&s)if n == 0 {break} else {for _, r = range s {if unicode.IsDigit(r) {if !unicode.IsDigit(char_pre) {s_o += "*"}} else {if unicode.IsDigit(char_pre) {s_o += "*"}}s_o += string(r)char_pre = r}if unicode.IsDigit(r) {s_o += "*"}fmt.Printf("%s\n", string(s_o))}}
}