foreach (char chr in input)
{
//检查字母
if (char.IsLetter(chr))
{
countLetters++;
}
//检查数字
if (char.IsDigit(chr))
{
countDigits++;
}
//检查标点
if (char.IsPunctuation(chr))
{
countPunctuation++;
}
}