//先将26个大写字母存到数组upper中
//再将26个小写字母存到数组lower中
for(int ch = 0; ch < line.length();ch++){
current = line.charAt(ch);
if(current >= 'A' && current <= 'Z')
upper[current-'A']++;
else
if(current >= 'a' && current <= 'z'){
lower[curent-'a']++;
}else
other++;
}
统计字符串中各个英文字母出现的次数(区分大小写)
最新推荐文章于 2024-03-22 08:35:19 发布