📅  最后修改于: 2022-03-11 14:49:25.153000             🧑  作者: Mango
// create multiplication table for a number
fn multiplication(n: u64) -> String {
(1..=12).map(|i| format!("{} * {} = {}", i, n, i * n)).collect::>().join("\n")
}
fn main() {
println!("{}", multiplication(7));
}