我编写此代码只是为了显示“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”标签内写入的完整内容?
慕的地8271018
相关分类