2

价值一个亿的人工智能算法(Rust 版)

 1 year ago
source link: https://tingfei.art/posts/one_billion_ai_algorithm/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

价值一个亿的人工智能算法(Rust 版)

2021-03-05
#![allow(unused)]
use std::io::stdin;

fn main() {
    loop {
        let mut s = String::new();
        stdin().read_line(&mut s)
            .expect("Failed to read line.");

        s = s.replace("吗", "");
        s = s.replace("我", "你");
        s = s.replace("?", "!");
        
        println!("艾瑞斯:{}", s);
    }
}
你好
艾瑞斯:你好

今天天气好吗
艾瑞斯:今天天气好

我是世界上最美的人吗
艾瑞斯:你是世界上最美的人

天呐,我竟然是猪 
艾瑞斯:天呐,你竟然是猪

吃饭?
艾瑞斯:吃饭!

https://github.com/ruanyf/weekly/issues/158


Just for fun 🤣


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK