Discuss / Java / 作业

作业

Topic source

完美佩恩

#1 Created at ... [Delete] [Delete and Lock User]

public class Main {

    public static void main(String[] args) {

        int[] ns = { 1, 4, 9, 16, 25 };

        for (int i=ns.length-1;i>=0; i--) {

            int n = ns[i];

            System.out.println(n);

        }

    }

}

yuxy20999

#2 Created at ... [Delete] [Delete and Lock User]

 public static void main(String[] args) {

        int[] ns = { 1, 4, 9, 16, 25 };

        for (int i=4; i>=0; i--) {

            System.out.println(ns[i]);

        }

    }

}


  • 1

Reply