2
我陷入了if
语句中,该语句评估“大于以前的数字”部分。 这里是我的代码:比较Array的元素无法正常工作
class ifBiggerPrint
{
public static void main (String []args)
{
double numbers[] = {2,4,6,9,5,4,5,3,1,5,6,2,1};
System.out.print("The numbers in the array which are bigger than the preceding number are: \n");
for (int i = 0; i < numbers.length; i++)
{
// if statement checks that number is greater than
// previous number in array?? Cant figure...
if (numbers [i] > numbers [i=+1])
{
System.out.println(numbers[i] + " ");
}
}
}
}
超!很棒。非常感谢! – CassyHiggins 2014-12-06 20:13:02