Finally solved the problem yesterday.

xiaoxiao2021-03-05  21

I ran in the morning, I will ask the teacher to find the root of the problem.

In fact, it is not very profound, mainly, I have written an algorithm to write an algorithm.

However, the difference is very serious, and it is very serious.

Int Arr [] = {95, 23, 45, 66, 79, 84, 100, 54, 87, 67, 94, 81, 83, 76, 84, 66, 88, 91, 25, 77, 84, 22, 56, 78, 49, 83, 89, 86, 84, 44};

For (int i = 0; I

The above is a problem

An error sentence is for (int J = 0; j

Arr.Length = 30 Because the number of Java's array is from 0 - N-1, the array subscript is the largest.

When i = 0, J = 0 J can be equal to 29 j

So when IF (Arr [J]

Because Arr [J 1] = Arr [30]

It is good to find the key to finding the problem.

Change for for (int J = 0; j

In the process of this debug, I learned from the teacher from the teacher.

Above the sentence of IF (Arr [J]

转载请注明原文地址:https://www.9cbs.com/read-38741.html

New Post(0)