⌨️
[AtCoder]ABC-080|B - Harshad Number
設問ページ
提出結果
def getInt():
return int(input())
def main():
x = getInt()
l = map(int, list(str(x)))
print('Yes' if x % sum(l) == 0 else 'No')
if __name__ == "__main__":
main()
def getInt():
return int(input())
def main():
x = getInt()
l = map(int, list(str(x)))
print('Yes' if x % sum(l) == 0 else 'No')
if __name__ == "__main__":
main()
Discussion