-5

我需要一个简单的 C# 问题解决方案

输入:任何身体都可以跳舞

输出:ABCD

4

2 回答 2

2
string inputString = "Another One Bites The Dust And Another One Down";
string[] split = inputString.Split();
foreach (string s in split)
{
    Console.Write(s.Substring(0,1));
}
于 2013-05-08T10:24:54.340 回答
1

看一下这个:

string s = new string("Any Body Can Dance"
                     .Split(' ')
                     .Select(x => x.First())
                     .ToArray());
Console.WriteLine(s);
于 2013-05-08T10:25:09.107 回答