public class Solution {
public static void main(String[] args) throws Exception {
//在此编写你的代码
String[] arr=new String[10];
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for(int i=0;i<8;i++){
arr[i]=reader.readLine();
}
for(int i=10;i>0;i--){
System.out.println(arr[i]);
}
}
}
I don't know how I fault
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
zimme
22 June 2020, 20:49
I don't know what the task is, so I can't help you exactly. But what I see in the code is that in the second for loop you try to access an element arr [10] that does not exist, the last element of the array is at position arr.length-1, remember that first element index in array is 0.
for (int i = arr.length-1; i >= 0; i--)
I hope I helped you
0
AKA
24 June 2020, 09:54
I already finished it,thx
0