该程序要求您输入一个单词和一个句子的最小长度。该程序的目的是计算一个句子中满足字母长度要求的单词数。有人可以帮我计算一下吗,字数不会增加。
public class wordcount {
public static void main(String[] args) {
int length = IO.readInt();
String sentence = IO.readString();
int full = sentence.length();
int wordcount = 0;
for(int i = 0; i == length; i++){
if(Character.isLetter(sentence.charAt(i)))
wordcount= wordcount + 1;
}
System.out.print(wordcount);
}
}