题解 | #牛牛的字符菱形#

牛牛的字符菱形

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));
    }
}

全部评论

相关推荐

mjasjon:这种trash中厂 简历过筛概率比大厂还低(除阿里系)
投递哔哩哔哩等公司6个岗位
点赞 评论 收藏
分享
求实习的小白1213:华科去这 你是真敢去啊
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务