вылазиет ошибка о том,что функция должна возвращать значение,но там везде стоит return
я не понимаю что она хочет
package com.javarush.task.task02.task0217;
/*
Минимум четырех чисел
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
if(a < b && a < c && a < d)
return a;
if(b < a && b < c && b < d)
return b;
if(c < b && c < d && c < a)
return c;
if(d < c && d < a && d < b)
return d;
}
public static int min(int a, int b) {
//напишите тут ваш код
if(a < b)
return a;
if(b < a)
return b;
}
public static void main(String[] args) throws Exception {
System.out.println(min(-20, -10));
System.out.println(min(-40, -10, -30, 40));
System.out.println(min(-20, -40, -30, 40));
System.out.println(min(-20, -10, -40, 40));
System.out.println(min(-20, -10, -30, -40));
}
}