Created
November 13, 2015 06:51
-
-
Save e-tverdokhleb/69e77b45386a7089e775 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
System.out.println(min(11, 12, 3)); | |
} | |
public static int min(int a, int b, int c) { | |
int min = a; | |
if (b < a) { | |
min = b; | |
} else if (c < a) { | |
min = c; | |
} | |
return min; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Что с логикой не все додумали. Для такого варианта вызова: min(1, -12, -33), результат должен быть -33, а у Вас -12.