문제 & 예시
소스코드
// 하샤드 수
public class test05 {
public static void main(String[] args) {
Solution5 sol = new Solution5();
int x = 12;
System.out.println(sol.solution(x));
}
}
class Solution5 {
public boolean solution(int x) {
boolean answer = true;
int sum = (x / 10) + (x % 10);
if(x%sum != 0) {
answer = false;
}
return answer;
}
}