📜  rust 接受用户输入 - Rust 代码示例

📅  最后修改于: 2022-03-11 14:49:24.587000             🧑  作者: Mango

代码示例1
//Declare dependencies
use std::io::stdin;

fn main() {
    //Declare a mutable input string
    let mut input_string = String::new();
    stdin().read_line(&mut input_string)
        .ok()
        .expect("Failed to read line");
}