public class TwiceAsOld{
public static int TwiceAsOld(int dadYears, int sonYears){
//TODO: Add code here
int years = dadYears - 2 * sonYears;
if (years > 0) {
return years;
}
return years * (-1);
}
}
'문제 풀이 > 자바' 카테고리의 다른 글
자바 문제 풀이 13 (0) | 2023.04.24 |
---|---|
자바 문제 풀이 12 (0) | 2023.04.23 |
자바 문제 풀이 10 (0) | 2023.04.19 |
자바 문제 풀이 9 (0) | 2023.04.18 |
자바 문제 풀이 8 (0) | 2023.04.17 |