int n = 0;
string[] words = new string[10];
int[] times = new int[10];
Console.WriteLine("请输入一个句子:");
string b = "Console.ReadLine()";
for (int i = 0; i < string.Length(b) - 2; i++)
{
bool isSame = false;
string source =string.Substring(i, 2);
int j = i + 2;
while (j < string.Length(b) - 2)
{
string target = string.Substring(j, 2);
if (source == target)
{
times[n]++;
if (Array.IndexOf(words, target) == -1)
{
isSame = true;
words[n] = target;
}
}
j++;
}
if (isSame) n++;
}
String.Format("一共有{0}个重复的词汇!\n\n其中,", n);
for (int i = 0; i < 10; i++)
{
if (!String.IsNullOrEmpty(words[i]))
{
}
}
一毛钱
相关分类