题解 | #牛牛的字符菱形#
牛牛的字符菱形
https://www.nowcoder.com/practice/11a5040fa894430f9d25fda1be37ddc8
use std::io::stdin; fn main() { let mut input = String::new(); stdin().read_line(&mut input).expect("msg"); let c = input.trim(); for i in 1..=3 { println!("{}{}", " ".repeat(3 - i), c.repeat(2 * i - 1)); } for i in 1..=2 { println!("{}{}", " ".repeat(i), c.repeat((3 - i) * 2 - 1)); } }