개발자노트
모듈화로 세 수 비교하기
hansummer
2022. 6. 15. 19:11
package class01;
public class Test02 {
int ans = 0;
static int func(int a, int b, int c) {
if (a > b) {
if (a > c) {
return a;
}
else {
return c;
}
}
else {
if (b > c) {
return b;
}
else {
return c;
}
}
}
public static void main(String[] args) {
int a = 50;
int b = 60;
int c = 30;
//System.out.println(func(a,b,c));
int Num = func(a, b, c);
System.out.println(Num + "이 가장 큰 정수입니다.");
}
}