public class Number {
public static void main(String[] args) {
// TODO Auto-generated method stub
//27. 1.给定某个字符数组,
//统计数组中所有英文字符的个数,
//比如“123fdd”中有 3 个。
char[] arr = {1,2,3,'a','b','c'};
int count = 0;
for(int i =0; i<arr.length;i++){
if(arr[i]>='a' && arr[i]<='z' ){
count++;
}else if( arr[i]>='A' && arr[i]<='z'){
count++;
}
}
System.out.println("请输入字符个数:"+count);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//27. 1.给定某个字符数组,
//统计数组中所有英文字符的个数,
//比如“123fdd”中有 3 个。
char[] arr = {1,2,3,'a','b','c'};
int count = 0;
for(int i =0; i<arr.length;i++){
if(arr[i]>='a' && arr[i]<='z' ){
count++;
}else if( arr[i]>='A' && arr[i]<='z'){
count++;
}
}
System.out.println("请输入字符个数:"+count);
}
}