Rust Leer Lines de Stdin y devolver un VEC
//read lines from stdin and return a vector
fn readlines() -> Vec<String> {
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);
}
Mackerel