qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())

f = 0
while N != 0:
    f += (N%10)
    N = N//10

if N%f == 0:
    print("Yes")
else :
    print("No")


Fixed code:
N = int(input())

f = 0
n = N
while n != 0:
    f += (n%10)
    n = n//10

if N%f == 0:
    print("Yes")
if N%f != 0:
    print("No")
Buggy code:
N=input()
s=sum([int(i) for i in N])

print('Yes' if N%s==0 else 'No')

Fixed code:
N=input()
s=sum([int(i) for i in N])

print('Yes' if int(N)%s==0 else 'No')
Buggy code:
N = int(input())
n = N
print(len(str(N)))

sum = 0
while N>0:
    N1 = N%10
    print(N1)
    sum += N1
    N = (N-N1)/10

if n%sum == 0:
    print('Yes')

else:
    print('No')


Fixed code:
N = int(input())
n = N


sum = 0
while N>0:
    N1 = N%10

    sum += N1
    N = (N-N1)/10

if n%sum == 0:
    print('Yes')

else:
    print('No')
Buggy code:
N = int(input())
n = N
fx = 0
while(n>0):
    fx += n % 10
    n /= 10
if(N%fx == 0):
    print('Yes')
else:
    print('No')


Fixed code:
N = int(input())
n = N
fx = 0
while(n>0):
    fx += n % 10
    n //= 10
if(N % fx == 0):
    print('Yes')
else:
    print('No')
Buggy code:
n=int(input())
f=sum(map(int,n))
print("No" if n%f else "Yes")

Fixed code:
n=int(input())
f=sum(map(int,str(n)))
print("No" if n%f else "Yes")
Buggy code:
A = int(input())
B = A
list=[]
while B > 0:
    list.append(B%10)
    B //=10
    print(list)
if A % sum(list) == 0:
    print("Yes")
else :
    print("No")


Fixed code:
A = int(input())
B = A
list=[]
while B > 0:
    list.append(B%10)
    B //=10
    #print(list)
if A % sum(list) == 0:
    print("Yes")
else :
    print("No")
Buggy code:
N = input()
L = list(N)
counter = 0
for i in range(len(L)) :
    l = int(L[i])
    counter += l
if int(N) % counter == 0 :
    print("Yes")
else :
    print("No")
    
print(counter)



Fixed code:
N = input()
L = list(N)
counter = 0
for i in range(len(L)) :
    l = int(L[i])
    counter += l
if int(N) % counter == 0 :
    print("Yes")
else :
    print("No")
Buggy code:
s=input()
ss=int(s)
keep=0
for i in range(len(s)):
  keep+=int(i)
if ss%keep==0:
  print("Yes")
else:
  print("No")


Fixed code:
s=input()
ss=int(s)
keep=0
for i in range(len(s)):
  keep+=int(s[i])
if ss%keep==0:
  print("Yes")
else:
  print("No")
Buggy code:
S = input()
q = 0
for i in list(S):
  q += i
if int(S)% q == 0:
  print("Yes")
else:
  print("No")

Fixed code:
S = input()
q = 0
for i in list(S):
  q += int(i)
if int(S)% q == 0:
  print("Yes")
else:
  print("No")
Buggy code:
n = int(input())
tmp = 0
for i in range(len(str(n))):
  tmp += str(n)[i]
if n % tmp == 0:
  print('Yes')
else:
  print('No')

Fixed code:
n = int(input())
tmp = 0
for i in range(len(str(n))):
  tmp += int(str(n)[i])
if n % tmp == 0:
  print('Yes')
else:
  print('No')
Buggy code:
n=int(input())
print('Yes' if n%sum(map(int,n))==0 else 'No')

Fixed code:
n=input()
print('Yes' if int(n)%sum(map(int,n))==0 else 'No')
Buggy code:
N = input()
sum = 0

for i in N:
    sum += i
if N % sum == 0:
    print("Yes")
else:
    print("No")


Fixed code:
N = input()
sum = 0

for i in N:
    sum += int(i)
if int(N) % sum == 0:
    print("Yes")
else:
    print("No")
Buggy code:
def f(x):
  if x <= 0:
    return 0
  return (x%10)+f(x//10)

n = int(input)
fx = f(n)
ans = "Yes" if n % fx == 0 else "No"
print (ans)

Fixed code:
def f(x):
  if x <= 0:
    return 0
  return (x%10)+f(x//10)

n = int(input())
fx = f(n)
ans = "Yes" if n % fx == 0 else "No"
print (ans)
Buggy code:
N = int(input())

B = N 
X = []

while B > 0:
    X.append(B%10)
    B //= 10

    print(X)
    print(B)
if N % sum(X) == 0:
    print("Yes")
else:
    print("No")

Fixed code:
N = int(input())

B = N 
X = []

while B > 0:
    X.append(B%10)
    B //= 10

if N % sum(X) == 0:
    print("Yes")
else:
    print("No")
Buggy code:
N = input()
print("Yes" if N%(sum(map(int, N))) == 0 else "No")

Fixed code:
N = input()
print("Yes" if int(N)%(sum(map(int, N))) == 0 else "No")
Buggy code:
N = int(input())
Nsum = 0
n = N
while n > 0:
    y = n % 10
    Nsum += y
    n = n // 10
if Nsum == N:
    print('Yes')
else:
    print('No')

Fixed code:
N = int(input())
Nsum = 0
n = N
while n > 0:
    y = n % 10
    Nsum += y
    n = n // 10
if N % Nsum == 0:
    print('Yes')
else:
    print('No')
Buggy code:
N = int(input())

def calcSumOfDigits(i):
    sum = 0
    for s in str(i):
        sum += int(s)
    return sum

sum = calcSumOfDigits(N)
if N == sum:
    print("Yes")
else:
    print("No")

Fixed code:
N = int(input())

def calcSumOfDigits(N):
    sum = 0
    for s in str(N):
        sum += int(s)
    return sum

sum = calcSumOfDigits(N)
if N%sum == 0:
    print("Yes")
else:
    print("No")
Buggy code:

N = input()

print("Yes" sum(map(int, N)) % int(N) == 0 else "No")


Fixed code:

N = input()

print("Yes" if int(N) % sum(map(int, N)) == 0 else "No")
Buggy code:
def f(n):
    return sum(map(int,str(n)))

X = int8(input())

if X % f(X) == 0:
    print('Yes')
else:
    print('No')

Fixed code:
def f(n):
  return sum(map(int, str(n)))

X = int(input())

if X % f(X) == 0: 
  print("Yes")
else:
  print("No")
Buggy code:
N=input()
a=list(N)
b=len(a)
sum=0
for i in range(b):
  a[i]=int(a[i])
  sum += a[i]
  print(a[i])
if(N%sum==0):
  print("Yes")
else:
  print("No")

Fixed code:
N=input()
a=list(N)
b=len(a)
sum=0
for i in range(b):
          a[i]=int(a[i])
          sum += a[i]
N=int(N)
if(N%sum==0):
              print("Yes")
else:
              print("No")
Buggy code:
N = int(input())
X = 0
while N:
  X += N % 10
  N //= 10
if N % X == 0:
  print("Yes")
else:
  print("No")

Fixed code:
N = int(input())
M = N
X = 0
while M:
  X += M % 10
  M //= 10
if N % X == 0:
  print("Yes")
else:
  print("No")
Buggy code:
n = int(input())
m = n
sum = 0
while m!= 0:
  sum += m % 10
  m //= 10
if sum % n == 0:
  print('Yes')
else:
  print('No')

Fixed code:
n_original =  int(input())
n = n_original
sum = 0
while n//10 != 0:
  sum += n%10
  n = n//10
sum += n
if n_original%sum==0:
  print('Yes')
else:
  print('No')
Buggy code:
N = map(int,input().split())

f = sum(list(map(int,str(N))))

if N % f == 0:
print("Yes")
else:
print("No")


Fixed code:
N = int(input())
f = sum(map(int,list(str(N))))

if N % f == 0:
        print("Yes")
else:
        print("No")
Buggy code:
n = input()
wa = 0
for i in range(len(n)):
  wa += int(n[i])
if n%wa:
  print("No")
else:
  print("Yes")

Fixed code:
n = input()
wa = 0
for i in range(len(n)):
  wa += int(n[i])
if int(n)%wa:
  print("No")
else:
  print("Yes")
Buggy code:
n = int(input())
m = n
sum = 0
while m!= 0:
  sum += m % 10
  m //= 10
if sum % n == 0:
  print(Yes)
else:
  print(No)

Fixed code:
n = int(input())
m = n
sum = 0
while m!= 0:
  sum += m % 10
  m //= 10
if n % sum == 0:
  print('Yes')
else:
  print('No')
Buggy code:
n = str(input())
sum = 0
for i in range(0, len(str(input()))): sum += int(n[i])
if int(n) % sum == 0: print("Yes")
else: print("No")

Fixed code:
n = str(input())
sum = 0
for i in range(0, len(n)):
  sum += int(n[i])
n = int(n)
if n % sum == 0:
  print("Yes")
else:
  print("No")
Buggy code:
N = input()
Nint = int(input())
fN = 0

for i in range(len(N)):
    fN += int(N[i])

if Nint % fN == 0:
    print("Yes")
else:
    print("No")

Fixed code:
N = input()
Nint = int(N)
fN = 0

for i in range(len(N)):
    fN += int(N[i])

if Nint % fN == 0:
    print("Yes")
else:
    print("No")
Buggy code:
n = int(input())
t = sum(map(int, list(str(n))))
if n // t == 0:
	print("Yes")
else:
	print("No")

Fixed code:
n = int(input())
t = sum(map(int, list(str(n))))
if n % t == 0:
	print("Yes")
else:
	print("No")
Buggy code:
N = int(input())
if N % sum([int(i) for i in str(N)]):
    print("Yes")
else:
    print("No")


Fixed code:
N = int(input())
if N % sum([int(i) for i in str(N)]) == 0:
    print("Yes")
else:
    print("No")
Buggy code:
x = input()
def f(x):
    return sum(map(int, list(str(x))))
if x % f(x) == 0:
    print("Yes")
else:
    print("No")

Fixed code:
x = int(input())
def f(x):
    return sum(map(int, list(str(x))))
if x % f(x) == 0:
    print("Yes")
else:
    print("No")
Buggy code:
N=input()
n=sum(map(int,str(N)))
if N%n==0:
  print("Yes")
else:
  print("No")

Fixed code:
N=int(input())
n=sum(map(int,str(N)))
print("Yes" if N%n==0 else "No")
Buggy code:
def solve():
    S = input()
    N = list(S)
    N = [int(x) for x in N]
    summation = sum(N)
    if summation % int(S) == 0:
        print("Yes")
    else:
        print("No")
       
      
solve()

Fixed code:
def solve():
    S = input()
    N = list(S)
    N = [int(x) for x in N]
    summation = sum(N)
    if int(S) % summation == 0:
        print("Yes")
    else:
        print("No")
       
      
solve()
Buggy code:
X = int(input())

def Sum_Digit(X):
  SUM = 0
  while X >= 1:
    SUM += X%10
    X = int((X - X%10)/10)
  return SUM

print(S)
if X%S == 0:
  print("Yes")
else:
  print("No")

Fixed code:
X = int(input())

def Sum_Digit(X):
  SUM = 0
  while X >= 1:
    SUM += X%10
    X = int((X - X%10)/10)
  return SUM

S = Sum_Digit(X)
if X%S == 0:
  print("Yes")
else:
  print("No")
Buggy code:
s = int(input())
x = 0

for i in s:
  x += int(i)

if s%x == 0:
  print("Yes")
else:
  print("No")

Fixed code:
n=input()
s=0
for i in n:
  s += int(i)
if int(n)%s==0:
  print("Yes")
else:
  print("No")
Buggy code:
a = int(input())
b = list(map(int,list(a)))

if a / sum(b) == 0:
  print("Yes")
else:
  print("No")

Fixed code:
a = input()
b = list(map(int,list(a)))

if int(a) % sum(b) == 0:
  print("Yes")
else:
  print("No")
Buggy code:
n=input()
a=[]
for i in range(len(n)):
  a.append(s[i])
print("Yes" if int(n)%sum(a)==0 else "No")


Fixed code:
n=input()
a=[]
for i in range(len(n)):
  a.append(int(n[i]))
print("Yes" if int(n)%sum(a)==0 else "No")
Buggy code:
N = input()
f = sum(map(int, N))
print("Yes" int(N) % f == 0 else "No")


Fixed code:
N = input()
f = sum(map(int, N))
print("Yes" if int(N) % f == 0 else "No")
Buggy code:
n = int(input())
nn = n
while n>0:
  sum+=n%10
  n= (n-n%10)/10
  
if nn%sum==0:
  print("Yes")
else:
  print("No")

Fixed code:
n = int(input())
nn = n
sum=0
while n>0:
  sum+=n%10
  n= (n-n%10)/10
  
if nn%sum==0:
  print("Yes")
else:
  print("No")
Buggy code:
import sys
input = sys.stdin.readline

def main():
    n = input()
    n_sum = sum([int(c) for c in n])
    if n % n_sum == 0:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Fixed code:
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    n_sum = sum([int(c) for c in str(n)])
    if n % n_sum == 0:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
Buggy code:
N=str(input())
A=sum(list(map(int, list(N))))
if N % A ==0:
  print("Yes")
else:
  print("No")

Fixed code:
N = int(input())
fn = sum(map(int, list(str(N))))
if N % fn == 0:
    print('Yes')
else:
    print('No')
Buggy code:
def f(X):
	total = 0
	while X > 0:
		total += X % 10
		X /= 10
	return total

N = int(input())

if N / f(N) == 0:
	print("Yes")
else:
	print("No")


Fixed code:
def f(X):
	total = 0
	while X > 0:
		total += X % 10
		X = X // 10
	return total

N = int(input())

if N % f(N) == 0:
	print("Yes")
else:
	print("No")
Buggy code:
x = input()
digits = [int(a) for a in x]
fx = sum(digits)
print("Yes" if x % fx == 0 else "No")



Fixed code:
x_str = input()
x = int(x_str)
digits = [int(a) for a in x_str]
fx = sum(digits)
if x % fx == 0:
  print("Yes")
else:
  print("No")
Buggy code:
N = input()
if N % sum(map(int, N)):
    print("No")
else:
    print("Yes")

Fixed code:
N = input()
if int(N) % sum(map(int, N)):
    print("No")
else:
    print("Yes")
Buggy code:
x=input()
f=0
for i in range(len(x)):
  f+=int(x[i])
  
if x%f==0:
  print('Yes')
else:
  ('No')

Fixed code:
x=input()
f=0
for i in range(len(x)):
  f+=int(x[i])
  
if int(x)%f==0:
  print('Yes')
else:
  print('No')
Buggy code:
N = input()
sum = 0

tmp = N
while (N >= 1):
    sum += N % 10
    N /= 10

if tmp % sum == 0:
    print ('Yes')
else:
    print('No')


Fixed code:
N = int(input())
sum = 0

tmp = N
while (N >= 1):
    sum += N % 10
    N //= 10

if tmp % sum == 0:
    print ('Yes')
else:
    print('No')
Buggy code:
N = int(input())
f_x=0
while (N>0):
    f_x+=N%10
    N=N//10

if N%f_x==0:
    print('Yes')
else:
    print('No')

Fixed code:
N=int(input())
f_x=0
n=N
while (n>0):
    f_x+=n%10
    n=n//10

if N%f_x==0:
    print('Yes')
else:
    print('No')
Buggy code:
def findSUM(n):
  sum = 0
  while( n > 0 ):
    sum += n % 10
    n //= 10
  return sum

N = int(input().split())

f = findSUM(N)
if (N % f == 0):
  print("Yes")
else:
  print("No")

Fixed code:
def findSUM(n):
  sum = 0
  while( n > 0 ):
    sum += n % 10
    n //= 10
  return sum

N = int(input())

f = findSUM(N)
if (N % f == 0):
  print("Yes")
else:
  print("No")
Buggy code:
N = int(input())

result = []
while N > 0:
    result.append(N % 10)
    N //= 10
if N % sum(result) == 0:
    print('Yes')
else:
    print('No')

Fixed code:
N = int(input())

result = []
memo = N
while memo > 0:
    result.append(memo % 10)
    memo //= 10

if N % sum(result) == 0:
    print("Yes")
else:
    print("No")
Buggy code:
X = input()
print('Yes' if X % sum(map(int, X)) == 0 else 'No')

Fixed code:
X = input()
print('Yes' if int(X) % sum(map(int, X)) == 0 else 'No')
Buggy code:
def find_sum_of_digits(n):
    total = 0
    while n > 0:
        total += n % 10
        n //= 10
    return total


N = int(input())
total = find_sum_of_digits(N)
print(N, total)
if N % total == 0:
    print("Yes")
else:
    print("No")


Fixed code:
def find_sum_of_digits(n):
    total = 0
    while n > 0:
        total += n % 10
        n //= 10
    return total


N = int(input())
total = find_sum_of_digits(N)
if N % total == 0:
    print("Yes")
else:
    print("No")
Buggy code:
n = int(input())
m = [int(c) for c in n]
print("No") if n%sum(m) else print("Yes")

Fixed code:
n = input()
m = [int(c) for c in n]
print("No") if int(n)%sum(m) else print("Yes")
Buggy code:
# -*- coding: utf-8 -*-
N = str(input())
a=[]
for i in range(N):
  S = int(N[i])
  a.append(S)
T = sum(S)
if int(N) % T == 0:
  print("Yes")
else:
  print("No")

Fixed code:
# -*- coding: utf-8 -*-
N = str(input())
a=[]
for i in range(len(N)):
  S = int(N[i])
  a.append(S)
T = sum(a)
if int(N) % T == 0:
  print("Yes")
else:
  print("No")
Buggy code:
import sys
input = sys.stdin.readline
n=int(input())
div=n
a=""
while n:
    a+=(str(n)[-1])
    #print(str(n)[-1])
    n//=10
#print(a)
a=a[::-1]
if int(a)%div==0:
    print("Yes")
else:
    print("No")


Fixed code:
import sys
input = sys.stdin.readline
n=int(input())
div=n
a=0
while n:
    a+=int((str(n)[-1]))
    #print(str(n)[-1])
    n//=10
#print(a)
if div%a==0:
    print("Yes")
else:
    print("No")
Buggy code:
s = input()
sum_of_digits = sum(map(int, s))
if (int)s % sum_of_digits:
  print('Yes')
else:
  print('No')

Fixed code:
s = input()
sum_of_digits = sum(map(int, s))
if int(s) % sum_of_digits == 0:
  print('Yes')
else:
  print('No')
Buggy code:
x = input()
n = (int)x
sum_of_digits = sum(map(int, x))
check = n % sum_of_digits
print('No' if check else 'Yes')



Fixed code:
x = input()
sum_of_digits = sum(map(int, x))
check = int(x) % sum_of_digits
print('No' if check else 'Yes')
Buggy code:
def main():
    N = int(input())
    f = 0
    for n in str(N):
        f += int(n)

    if f%N == 0:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()



Fixed code:
def main():
    N = int(input())
    f = 0
    for n in str(N):
        f += int(n)

    if N%f == 0:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
Buggy code:
N=input()
def digitsum(N) :
  s = str(N)
  array = list(map(int, list(s)))
  T = sum(array) 
  return T

U = digitsum(N)

if N % U ==0 :
  print("Yes")
else:
  print("No")

Fixed code:
N=int(input())
def digitsum(N) :
  s = str(N)
  array = list(map(int, list(s)))
  T = sum(array) 
  return T

U = digitsum(N)

if N % U ==0 :
  print("Yes")
else:
  print("No")
Buggy code:
A = int(input())
N = A
a = []
for i in reversed(range(len(str(N)))):
	a.append(int(N/10**(i)))
	N -= int(N/10**i)*10**i
X = sum(a)
print(X)
print(a)
if A % X == 0:
	print("Yes")
else:
	print("No")

Fixed code:
A = int(input())
N = A
a = []
for i in reversed(range(len(str(N)))):
	a.append(int(N/10**(i)))
	N -= int(N/10**i)*10**i
X = sum(a)
if A % X == 0:
	print("Yes")
else:
	print("No")
Buggy code:
N = input()
X = 0
for i in range(len(N)):
  X += int(N[i])
if N % X == 0:
  print("Yes")
else:
  print("No")

Fixed code:
N = input()
X = 0
for i in range(len(N)):
  X += int(N[i])
if int(N) % X == 0:
  print("Yes")
else:
  print("No")
Buggy code:
x = input()

keta = len(str(x))

f = []
for i in range(keta):
    f.append(int(str(x)[i]))
f = sum(f)

if x%f == 0:
    print('Yes')
else:
    print('No')

Fixed code:
x = int(input())

keta = len(str(x))

f = []
for i in range(keta):
    f.append(int(str(x)[i]))
f = sum(f)

if x%f == 0:
    print('Yes')
else:
    print('No')
Buggy code:
n  = int(input())
kakuketanowa = sum(map(int, list(str(n))))
if x % kakuketanowa == 0:
	print("Yes")
else:
	print("No")


Fixed code:
n  = int(input())
kakuketanowa = sum(map(int, list(str(n))))
if n % kakuketanowa == 0:
	print("Yes")
else:
	print("No")
Buggy code:
n = input()
x = sum(map(int,n))
print('Yes' if n%x == 0 else 'No')


Fixed code:
n = input()
x = sum(map(int,n))
print('Yes' if int(n)%x == 0 else 'No')
Buggy code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    n = int(input)
    N = list(str(n))
    
    tmp = 0
    for i in N:
        tmp += i
        
    if n % tmp == 0:
        print("Yes")
    else:
        print("No")
            	
if __name__ == "__main__":
	main()


Fixed code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    n = int(input())
    N = list(str(n))
    
    tmp = 0
    for i in N:
        tmp += int(i)
        
    if n % tmp == 0:
        print("Yes")
    else:
        print("No")
            	
if __name__ == "__main__":
	main()
Buggy code:
N=int(input())
i=0
summ=0

def kakuwa(N):
  while N>10**i:
    i+=1
  for k in range(i+1)[::-1]:
    summ+=N//(10**k)
    N-=(10**k)*(N//(10**k))
  return(summ)

if N%kakuwa(N)==0:
  print("Yes")
else:
  print("No")

Fixed code:
N=int(input())
def kakuwa(N):
  summ=0
  i=0
  while N>10**i:
    i+=1
  for k in range(i+1)[::-1]:
    summ+=N//(10**k)
    N-=(10**k)*(N//(10**k))
  return(summ)

if N%kakuwa(N)==0:
  print("Yes")
else:
  print("No")
Buggy code:
N = int(inout)
L = [int(j) for j in str(N)]
if N % sum(L) == 0:
    print("Yes")
else:
    print("No")

Fixed code:
N = int(input())
L = [int(j) for j in str(N)]
if N % sum(L) == 0:
    print("Yes")
else:
    print("No")
Buggy code:
a = (input())
number_2 = [int(s) for s in a]
total = sum(number_2)
print(total)
if int(a) % total == 0:
  print('Yes')
else:
  print('No')

Fixed code:
a = (input())
number_2 = [int(s) for s in a]
total = sum(number_2)
if int(a) % total == 0:
  print('Yes')
else:
  print('No')
Buggy code:
N=str(input())
print(N)
X=int(N)
fx=0
for i in range(0,len(N)):
    fx+=int(N[i])

if X%fx==0:
    print("Yes")
else:
    print("No")

Fixed code:
N=str(input())

X=int(N)
fx=0
for i in range(0,len(N)):
    fx+=int(N[i])

if X%fx==0:
    print("Yes")
else:
    print("No")
Buggy code:
N = input()
 
print('Yes' if sum(map(int, list(N))) % int(N) == 0 else 'No')

Fixed code:
N = input()

print('Yes' if int(N) % sum(map(int, list(N))) == 0 else 'No')
Buggy code:
n = int(input())
sum = 0
for i in str(n):
    sum += int(i)
if(N%sum==0):
    print("Yes")
else:
    print("No")

Fixed code:
n = int(input())
sum = 0

for i in str(n):
    sum += int(i)
    
if(n%sum==0):
    print("Yes")
else:
    print("No")
Buggy code:
n = int(input())
nh = sum(list(map(int,str(n))))
if nh%n==0 :
    print("Yes")
else:
    print("No")

Fixed code:
n = int(input())
if n % sum(map(int, list(str(n)))) == 0:
        print('Yes')
else:
        print('No')
Buggy code:
N = input()

f = [int(i) for i in N]
if N%f == 0:
    print("Yes")
else:
    print('No')


Fixed code:
N = input()

num = [int(i) for i in N]
f = sum(num)
if int(N)%f == 0:
    print("Yes")
else:
    print('No')
Buggy code:
import math

N = int(input())
l = [int(x) for x in list(str(N))]

if X%sum(l) == 0:
    print('Yes')
else:
    print('No')



Fixed code:
import math

N = int(input())
l = [int(x) for x in list(str(N))]

if N%sum(l) == 0:
    print('Yes')
else:
    print('No')
Buggy code:
N = str(input())
A = 0
for i in N:
    A += int(i)
return "Yes" if N%A == 0 else "No"  

Fixed code:
N = str(input())
A = 0
for i in N:
    A += int(i)
print("Yes" if int(N)%A == 0 else "No")
Buggy code:
n=int(input())
a=0
a+=n%10
b=n//1 
while b>0:
    a+=b%10
    b=b//10
print('Yes' if n%a==0 else 'No')

Fixed code:
n=int(input())
a=0
a+=n%10
b=n//10 
while b>0:
    a+=b%10
    b=b//10
print('Yes' if n%a==0 else 'No')
Buggy code:

def sum_digit(num):
    sums = 0
    while num != 0:
        sums += num % 10
        num //= 10
    return sums

n = int(input())
if sum_digit(n)%n == 0:
    print('Yes')
else:
    print('No')

Fixed code:
def sum_digit(num):
    sums = 0
    while num != 0:
        sums += num % 10
        num //= 10
    return sums

n = int(input())
if n % sum_digit(n) == 0:
    print('Yes')
else:
    print('No')
Buggy code:
def digit10(x):
    while(x>0):
        dten=0
        dten+=x%10
        x/=10
    return dten

n = int(input())
if n%digit10(n)==0:
    print("Yes")
else:
    print("No")

Fixed code:
def digit10(x):
    dten = 0
    while(x>0):
        dten+=int(x%10)
        x/=10
    return dten

n = int(input())
if n%digit10(n)==0:
    print("Yes")
else:
    print("No")
Buggy code:
n = input()
print('Yes') if n % sum(map(int, n)) == 0 else print('No')

Fixed code:
n = input()
print('Yes') if int(n) % sum(map(int, n)) == 0 else print('No')
Buggy code:
n = input()
if sum(list(map(int,(n)))) % int(n)==0:
    print("Yes")
else:
    print("No")

Fixed code:
inp = input()
nn = int(inp)
n = list(inp)
n = list(map(int,n))
if nn%sum(n) == 0:
  print('Yes')
else:
  print('No')
Buggy code:
n=input()
x=int(n)
y=0
for i in n:
    y+=int(i)
print(y)
print(x)
if x%y==0:
    print("Yes")
else:
    print("No")
    

Fixed code:
n=input()
x=int(n)
y=0
for i in n:
    y+=int(i)
if x%y==0:
    print("Yes")
else:
    print("No")
Buggy code:
def sum_digits(n):
    s = 0
    while n:
        s += n%10
        n //= 10
    return s

n = int(input())

ans = "Yes" if sum_digits(n) % n == 0 else "No"
print(ans)

Fixed code:
def sum_digits(n):
    s = 0
    while n:
        s += n%10
        n //= 10
    return s

n = int(input())

ans = "Yes" if n % sum_digits(n) == 0 else "No"
print(ans)
Buggy code:
N = input()

tmp = 0

for i in range(len(N)):
    tmp += int(N[i])
    
if tmp % int(N) == 0:
    print('Yes')
else:
    print('No')

Fixed code:
N = input()

tmp = 0

for i in range(len(N)):
    tmp += int(N[i])
    
if int(N) % tmp == 0:
    print('Yes')
else:
    print('No')
Buggy code:
X = str(input())
tmp = 0
for i in range(len(X)):
  tmp += int(X[i])

if X % tmp == 0:
  print('Yes')
else:
  print('No')

Fixed code:
X = str(input())
tmp = 0
for i in range(len(X)):
  tmp += int(X[i])

if int(X) % tmp == 0:
  print('Yes')
else:
  print('No')
Buggy code:
def num(x):
  ans=0
  while x>0:
    ans+=x%10
    x=x//10
  return ans
n=int(input())
if n%num(n)==0:
  print('Yes')
else:
  print('NO')

Fixed code:
def num(x):
  ans=0
  while x>0:
    ans+=x%10
    x=x//10
  return ans
n=int(input())
if n%num(n)==0:
  print('Yes')
else:
  print('No')