方法一:打表(简单高效) use std::io; fn main() { let mut s = String::new(); io::stdin().read_line(&mut s).expect("Failed to read line"); let n = match s.trim().parse::<u32>().unwrap() { 1..=5 => 0, 6..=27 => 1, 28..=495 => 2, 496..=8127 => 3, 8128..=33_550_335 => 4, _ => 5, }; prin...