面试题答案
一键面试fn print_text_with_count(text: &str, count: u32) {
for _ in 0..count {
print!("{}", text);
}
println!();
}
你可以使用以下方式调用这个函数:
fn main() {
let text = "Hello";
let count = 3;
print_text_with_count(text, count);
}