为了账号安全,请及时绑定邮箱和手机立即绑定

为什么这个html页面的完整内容没有显示

为什么这个html页面的完整内容没有显示

桃花长相依 2023-11-13 10:37:57
我编写此代码只是为了显示“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 回答

?
慕的地8271018

TA贡献1796条经验 获得超4个赞

正如评论中所指出的,问题在于代码中的尖括号 (<>) 弄乱了 HTML 布局。

只需<逐一替换就可以了。&lt;>&gt;


查看完整回答
反对 回复 2023-11-13
  • 1 回答
  • 0 关注
  • 38 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信