/*人工智能*/
package main

import (
    "bufio"
    "fmt"
    "os"
    "strings"
)

func main() {
    r:= bufio.NewReader(os.Stdin)
    for {
        c,err:= r.ReadString('\n')
        if err==nil{
            c = strings.Replace(c,"吗","",-1)
            c = strings.Replace(c,"请问","",-1)
            c = strings.Replace(c,"你好,","",-1)

            c = strings.Replace(c,"? ","!",-1)
            c = strings.Replace(c,"?","!",-1)
            c = strings.Replace(c,"你","我",-1)
            c = strings.Replace(c,"您","我",-1)
            fmt.Println(c)
        }
    }
}

运行效果

请问你会说中文吗?
我会说中文!
最后修改:2021 年 02 月 18 日 09 : 59 PM
如果觉得我的文章对你有用,请随意赞赏