题解 | #截取字符串#
截取字符串
https://www.nowcoder.com/practice/a30bbc1a0aca4c27b86dd88868de4a4a
use std::io::{self, *};
fn main() {
let stdin = io::stdin();
let str = stdin.lock().lines().next().unwrap().unwrap();
let len = stdin.lock().lines().next().unwrap().unwrap();
let new_len: usize = len.parse().unwrap();
println!("{}", &str[0..new_len]);
}
查看18道真题和解析