public static int who(string word)
{
//正则表达式
System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(@"^[A-Za-z]+$");
if(!reg.IsMatch(word))
{
return 0;
}
int flag = 0;
int index = 0;
byte[] inputString = Encoding.UTF8.GetBytes(word);
ArrayList al = new ArrayList(inputString);
for (int i = 0; i < al.Count; i++)
{
index = 0;
for (int j = 0; j<al.Count;j++ )
{
if((byte)al[index]>=(byte)al[j])
{
index = j;
}
}
if(index != 0)
{
flag++;
}
al.RemoveAt(index);
}
Console.WriteLine(flag);
if(flag%2 == 0)
{
return 0;
}
return 1;
}