ABC101B - Digit Sums
#include <iostream> using namespace std; int getS(int x_n) { int ret = 0; while (x_n > 0) { ret += x_n % 10; x_n /= 10; } return ret; } int main(void) { int n; cin.tie(0); ios::sync_with_stdio(false); cin >> n; cout << (n % getS(n) == 0? "Yes" : "No") << "\n"; return 0; }