33 lines
973 B
C#
33 lines
973 B
C#
using System.Text;
|
||
|
||
namespace _10_5
|
||
{
|
||
internal class Program
|
||
{
|
||
static void Main(string[] args)
|
||
{
|
||
StringBuilder sb = new StringBuilder();
|
||
bool bContinue = true;
|
||
while (bContinue)
|
||
{
|
||
Console.Write("请输入英文单词:");
|
||
string s =Console.ReadLine();
|
||
if (s != "")
|
||
{
|
||
sb.Append(s);
|
||
sb.Append(" ");
|
||
}
|
||
else
|
||
{
|
||
bContinue = false;
|
||
}
|
||
}
|
||
string str = sb.ToString();
|
||
Console.WriteLine("共{0}字符,内容为{1}",sb.Length,str);
|
||
string[] source = str.ToLower().Split(new char[] { '.', '?', '!', ':', ':', ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||
Array.Sort(source);
|
||
foreach (string s in source) Console.WriteLine(s);
|
||
}
|
||
}
|
||
}
|