немного не поняла почему не выходит. пишет :"Метод min(a, b, c, d) должен возвращать минимальное значение из чисел a, b, c, d."
package com.javarush.task.task02.task0217;
/*
Минимум четырех чисел
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
//напишите тут ваш код
if (min(a,b)>d & d<c){
return d;
}
else if(min(a,b)>c & c<d){
return c;
}
else {
return b;
}
}
public static int min(int a, int b) {
//напишите тут ваш код
if (a<b){
return a;
}
else {
return b;
}
}
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));
}
}