题解 | #简写单词#

简写单词

https://www.nowcoder.com/practice/0cfa856bf0d649b88f6260d878f35bb4

using System;

class Program {
    static void Main(string[] args) {
        string input = Console.ReadLine();

        Console.WriteLine("" + Abbreviate(input));
    }

    static string Abbreviate(string input) {
        string[] words = input.Split(' ');
        string abbreviation = "";
        foreach (string word in words) {
            if (!string.IsNullOrWhiteSpace(word)) {
                abbreviation += char.ToUpper(word[0]);
            }
        }
        return abbreviation;
    }
}

全部评论

相关推荐

你背过凌晨4点的八股文么:简历挂了的话会是流程终止,像我一样
点赞 评论 收藏
分享
03-17 19:21
门头沟学院 Java
面试官_我太想进步了:正常企查查显示的员工一般比设计的少
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务