public static void Main(string[] args)
{
string instr = Console.ReadLine();
int dx = 0;
int xx = 0;
foreach (char c in instr)
{
if (c >= 'A' && c <= 'Z')
{
dx++;
}
else if (c >= 'a' && c <= 'z')
{
xx++;
}
}
Console.WriteLine("大写字母{%d}个小写字母{%d}个", dx, xx);
}
温馨提示:内容为网友见解,仅供参考