#K81857. Harshad Number Checker
Harshad Number Checker
Harshad Number Checker
Given a positive integer \(n\), determine whether it is a Harshad Number.
A number \(n\) is called a Harshad number if it is divisible by the sum of its digits. Formally, if \(S(n)\) represents the sum of the digits of \(n\), then \(n\) is a Harshad number if and only if $$ n \equiv 0 \pmod{S(n)}. $$
inputFormat
The input consists of a single positive integer \(n\) provided via standard input.
outputFormat
Output Yes
if \(n\) is a Harshad number; otherwise, output No
. The output should be written to standard output.
18
Yes