我編寫此代碼只是為了顯示“pre”標(biāo)記內(nèi)寫入的內(nèi)容并將其保存為 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 中運(yùn)行它,但我得到的輸出為: 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)中不顯示完整內(nèi)容?需要進(jìn)行哪些更改才能在瀏覽器中顯示“pre”標(biāo)簽內(nèi)寫入的完整內(nèi)容?
1 回答

慕的地8271018
TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超4個贊
正如評論中所指出的,問題在于代碼中的尖括號 (<
和>
) 弄亂了 HTML 布局。
只需<
逐一替換就可以了。<
>
>
- 1 回答
- 0 關(guān)注
- 127 瀏覽
添加回答
舉報
0/150
提交
取消