题解 | #字符串最后一个单词的长度#
字符串最后一个单词的长度
https://www.nowcoder.com/practice/8c949ea5f36f422594b306a2300315da
use std::io::{self, *}; fn main() { let stdin = io::stdin(); unsafe { for line in stdin.lock().lines() { let ll = line.unwrap(); let numbers: Vec<&str> = ll.split(" ").collect(); let aim = numbers[numbers.len()-1].as_bytes().len(); print!("{}\n", aim); } } }