编程题找错
using System;namespace Project1
{
class hebin
{
public void sb(char[] str1, char[] str2)
{
int i, j=0;
for (i = 0; i < str1.Length; i++)
{
if (str1[i] == str1[i + 1])
i++;
else
{ str2[j] = str1[i]; j++; }
for (int k = 0; k < str2.Length; k++)
{ Console.WriteLine(str2[k]); }
}
}
class Program
{
static void Main()
{
int i;
char[] s1; char[] s2;
hebin xubin = new hebin();
for (i = 0; i<100;i++ )
s1[i] = Console.ReadKey().KeyChar;
xubin.sb(s1, s2);
}
}
}
}