📅  最后修改于: 2022-03-11 14:49:25.138000             🧑  作者: Mango
//read lines from stdin and return a vector
fn readlines() -> Vec {
use std::io::prelude::*;
let stdin = std::io::stdin();
let v = stdin.lock().lines().map(|x| x.unwrap()).collect();
v
}
// sample usage
fn main() {
let f = readlines();
println!("{:?}", f);
}