看看哪里不对
System.out.print("How many words do you want to enter: ");count=keyboard.nextInt();
String[] sentence=new String[count];
for(int i=0; i<count; i++)
{
System.out.print("Enter word #"+(i+1)+":");
sentence[i]=keyboard.nextLine();
}
输出应该是: how many words do u want to enter
3
enter word #1: ddd
enter word #2: dssdf
......
但是现在我的输出是:
how many words do u want to enter
3
enter word #1: enter word #2: dssdf
enter word #3: .....
为什么第一个跳过去了(不让我输入1,自动跳到2了), 大家看看毛病在哪里