ユーザーが入力した文の単語をカウントするプログラムの作成方法を理解する必要があります。ユーザーは、各単語の長さも入力します。したがって、ユーザーが 5 文字の単語を入力し、その文に 4 文字の単語が含まれている場合は、次のようになります。その単語はカウントされません。
持っているのはこれだけ...
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++){
}
System.out.print(wordcount);
}
}