체감 Level : ★ ☆ ☆ Review: 나머지연산 |
class Solution {
public int solution(int hp) {
int answer = 0;
int a = 5;
int b = 3;
int c = 1;
answer = hp / a; //4
if ((hp % 10) % b == 0){ // 3
answer += hp % 10 / b;
} else { // 4
answer += hp % 10 / b; // 3
answer += hp % 10 % b; // 1
}
return answer;
}
}