题解 | #简写单词#
简写单词
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; } }