编程知识 cdmana.com

Java simple array sorting

int[][] scores = {
                { 82, 90, 91 },
                { 68, 72, 64 },
                { 95, 91, 89 },
                { 67, 52, 60 },
                { 79, 81, 85 },
        };
        double sum=0,age=0;
        for(int i=0;ins[j]){
                    int w=ns[i];
                    ns[i]=ns[j];
                    ns[j]=w;
                }
            }
        }
        //  After ordering :
        System.out.println(Arrays.toString(ns));
        if (Arrays.toString(ns).equals("[96, 89, 73, 65, 50, 36, 28, 18, 12, 8]")) {
            System.out.println(" Test success ");
        } else {
            System.out.println(" Test to fail ");
        }
//        int[] ns = { 13, 41, 92, 16, 25 };
//        //  Print array elements in reverse order :
//        for(int i=0;ins[j]){
//                    int w=ns[i];
//                    ns[i]=ns[j];
//                    ns[j]=w;
//                }
//            }
//        }
//        System.out.println(Arrays.toString(ns));
//        Arrays.sort(ns);
//        System.out.println(Arrays.toString(ns));

This article altogether 34 Number of words , Average reading time ≈ 1 minute

Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .

版权声明
本文为[await]所创,转载请带上原文链接,感谢
https://cdmana.com/2021/09/20210909125824235d.html

Scroll to Top