Auf Thema antworten

ok,das hab ich verstanden   :D

hab da jetzt auch schonmal was probiert,aber ich bekomm nur das array mit den werten 5 raus. aber wie krieg ich die länge und die position raus.



[code=Java]

public class Plateau {

   

    public static void main(String[] args) {

        int a[] = {2, 5, 5, 5, 4, 4, 3, 2, 4, 2, 3, 3};

        int laenge;

        laenge = a.length;

       

        System.out.print("Array a: ");

        for (int i = 0; i < a.length; i++)

            System.out.print (a[i] + "  ");

       

        double max = Double.NEGATIVE_INFINITY;

        for (int i = 0; i < laenge; i++)

            if (a[i] > max

                max = a[i];

        System.out.println("\n\nMaximum: " + max;

       

    }

}

[/code]



Oben