输入输出流

控制台读取字符串

use std::io;

fn main() {
    // 创建字符串
    let mut readStr = String::new();   
    // 从控制台把字符读入readStr
    io::stdin().read_line(&mut readStr).expect("exception");
    // 打印输入内容
    println!("your input : {}",readStr);
}

results matching ""

    No results matching ""