看看怎么写程序。。

生在蓝天下,共同成长进步。(:
[CODE]
/**
*
*/
package com.test;
/**
* @author 支离破碎
*
*/
public class CountLetters {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String[] letters = {"a","e","i","o","u"};
System.out.println(getCountLetters("hello China!",letters));
}
public static int getCountLetters(String countStr,String[] letters){
int returnNum=0;
for(int i=0;i<countStr.length();i++){
for(int j=0;j<letters.length;j++){
if(letters[j].equalsIgnoreCase(countStr.substring(i,i+1))){
returnNum++;
}
}
}
return returnNum;
}
}
[/CODE]
在他的程序修改下就可以了!他写得还可以~
楼主要厚道点!~不要......
import java.util.Scanner;
public class CountLetters {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
System.out.print("请出入你要得字符串:");
String str=in.nextLine();
String[] letters = {"a","e","i","o","u"};
System.out.println(getCountLetters(str,letters));
}
public static int getCountLetters(String countStr,String[] letters){
int returnNum=0;
for(int i=0;i<countStr.length();i++){
for(int j=0;j<letters.length;j++){
if(letters[j].equalsIgnoreCase(countStr.substring(i,i+1))){
returnNum++;
}
}
}
return returnNum;
}
}