링크 : https://school.programmers.co.kr/learn/courses/30/lessons/12947
#include <string>
#include <vector>
using namespace std;
bool solution(int x) {
bool answer = true;
string str = to_string(x);
vector<int> n;
int sum = 0;
for(char ch : str){
n.push_back(ch - '0');
}
for(int i = 0; i < n.size(); i++){
sum += n[i];
}
if(x % sum == 0){
answer = true;
}
else answer = false;
return answer;
}