我編寫此代碼只是為了顯示“pre”標記內寫入的內容并將其保存為 abc.html <pre> public class ReverseArr { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("Enter the size of array : "); int n = scanner.nextInt(); //Declaring the array int arr[] = new int[n]; System.out.println("Enter the array elements : "); for(int i=0;i<n;i++) { arr[i] = scanner.nextInt(); } System.out.println("The Entered elements are : "); for(int i=0;i<n;i++) { System.out.print(arr[i] + " "); } System.out.println(); System.out.println("The reverse of array is : "); for(int i=n-1;i>=0;i--) { System.out.print(arr[i] + " "); } } } </pre>我在 Chrome 和 Firefox 中運行它,但我得到的輸出為: public class ReverseArr { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("Enter the size of array : "); int n = scanner.nextInt(); //Declaring the array int arr[] = new int[n]; System.out.println("Enter the array elements : ");/*After that problem occurs*/ for(int i=0;i=0;i--) { System.out.print(arr[i] + " "); } } }為什么瀏覽器(Chrome、Firefox)中不顯示完整內容?需要進行哪些更改才能在瀏覽器中顯示“pre”標簽內寫入的完整內容?
- 1 回答
- 0 關注
- 129 瀏覽
添加回答
舉報
0/150
提交
取消