0
我通常从不使用字符,所以很抱歉,如果它似乎是一个noob问题。我做了Crypter,并希望做“如果有至少4型动物字符,然后隐窝,否则不地下室和返回错误”计算多少个字符
实际代码:
string msg = Console.ReadLine();
char[] msgToChar = msg.ToCharArray();
if(here is the problem)
{
Console.WriteLine("Crypted message: " + Crypt(msg.ToUpper()));
}
else
{
Console.WriteLine("Please enter at least 4 differentes characters.");
}
你可以使用'GroupBy'。 –
'Distinct'和'Count'会更容易阅读。 – CaffGeek