下面是一个无规则的字符串,请使用程序统计在该字符串中字符a出现的次数:
abcabcdafsdhakfhjbajkfbabdjlkbFcjBajkhfjafjkahjfhajfljahfjbajsckahwfeabcjbzamanabKJDGuawvgfbvjhkvbzsjchvHVZHdvhjkvcjhVdajaegwh
public class Demo2 {
public static void main(String[] args) {
String str = “abcabcdafsdhakfhjbajkfbabdjlkbFcjBajkhfjafjkahjfhajfljahfjbajsckahwfeabcjbzamanabKJDGuawvgfbvjhkvbzsjchvHVZHdvhjkvcjhVdajaegwh”;
int times = 0;
for(int i = 0;i
String操作
最新推荐文章于 2022-12-22 11:16:07 发布