본문 바로가기

CodingTest/java

절댓값을 구할 때 - Math.abs()

반응형

int a = 3, b = 2; 일 때

| b - a | 의 값을 구하려면

Math.abs(b-a);

반응형