public class hhh{
public static void main(String[]args)
{
String s1="hkdhskhegoihwhonfdsaaa";
int count=0;
for(int x=0;x<s1.length();x++) {
if(‘a‘==s1.charAt(x)) count++;
}
System.out.println(count);
}
}
s1.charAt(x)=='a'
时间: 2025-01-06 04:26:27