Hallo!
Leider hänge ich bei dem zweiten Teil des Codes...
Mir wird Zeile 37 als Fehlermeldung angezeigt... wahrscheinlich, weil mir davor noch der Code fehlt. Hab aber leider keine Ahnung, was ich da noch schreiben soll?!
Könnte mir bitte jemand weiterhelfen?
Dankeschön schon einmal im Voraus?!
package de.codegym.task.task02.task0217;
/*
Die kleinste aus vier Zahlen
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
//schreib hier deinen Code
int minimum = 0;
if (a <= b && a <= c && a <= d)
{
minimum = a;
}
else if (b <= a && b <= c && b <= d)
{
minimum = b;
}
else if (c <= a && c <= b && c <= d)
{
minimum = c;
}
else if (d <= a && d <= b && d <= c)
{
minimum = d;
}
return minimum;
}
public static int min(int a, int b) {
//schreib hier deinen Code
}
public static void main(String[] args) throws Exception {
System.out.println(min(-20, -10));
System.out.println(min(-20, -10, -30, -40));
System.out.println(min(-20, -10, -30, 40));
System.out.println(min(-40, -10, -30, 40));
}
}