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

ans = 0
while(n > 0):
  ans += n % 10
  n /= 10
  
if ans == n:
  print('Yes')
else:
  print('No')

Fixed code:
n = int(input())

ans = 0
num = n
while(n > 0):
  ans += n % 10
  n = n // 10
  
if num % ans == 0:
  print('Yes')
else:
  print('No')
Buggy code:
n=int(input())
sum=0
t=n
while t>0:
    sum=t%10
    t=t//10
print('Yes' if n%sum==0 else 'No')

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

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

Fixed code:
a = input()
x = 0
for i in range(len(a)):
    x += int(a[i])
print("Yes" if int(a) % x == 0 else "No")
Buggy code:
def solve():
    s = input()
    t = 0
    for i in s:
        t += int(i)
    print(t)

    X = int(s)

    print(X % t)
    if X % t:
        print("No")
    else:
        print("Yes")


if __name__ == '__main__':
    solve()

Fixed code:
def solve():
    s = input()
    t = 0
    for i in s:
        t += int(i)

    X = int(s)

    if X % t:
        print("No")
    else:
        print("Yes")


if __name__ == '__main__':
    solve()
Buggy code:

N=input()
s=0
for i in N:
    s+=int(i)
    
if N%s==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:
n=int(input())
ans=0
while n>0:
  ans=int(n%10)+ans
  n=int(n/10)

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

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

print('Yes' if n2%ans==0 else 'No')
Buggy code:
n=int(input())
st=str(n)

sm = 0
for i in st:
  sm+=int(i)
if n%sm==0:
  print("Yes")
else
  print("No")

Fixed code:
n=int(input())
st=str(n)

sm = 0
for i in st:
  sm+=int(i)
if n%sm==0:
  print("Yes")
else:
  print("No")
Buggy code:
n=str(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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
N = int(input())
n = N
sumup = 0
while N != 0:
    print(N % 10)
    sumup += (N % 10)
    N = N // 10
#print(n, sumup)
if n % sumup == 0:
    print('Yes')
else:
    print('No')

Fixed code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
N = int(input())
n = N
sumup = 0
while N != 0:
    #print(N % 10)
    sumup += (N % 10)
    N = N // 10
#print(n, sumup)
if n % sumup == 0:
    print('Yes')
else:
    print('No')
Buggy code:
N = input()
S = 0
for i in range(len(N)):
  S += int(S[i])
if int(N) % S == 0:
  print("Yes")
else:
  print("No")

Fixed code:
N=input()
cnt=0

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

if int(N)%cnt==0:
    print("Yes")
    
else:
    print("No")
Buggy code:
def calc_sum_digits(n):
    sumd = 0
    while(int(n) > 0):
        sumd += int(n%10)
        n /= 10
    return sumd

N = int(input())
sumd = calc_sum_digits(N)
if(N%sumd == 0):
     print('yes')
else:
     print('No')

Fixed code:
def calc_sum_digits(n):
    sumd = 0
    while(int(n) > 0):
        sumd += int(n%10)
        n /= 10
    return sumd

N = int(input())
sumd = calc_sum_digits(N)
if(N%sumd == 0):
     print('Yes')
else:
     print('No')
Buggy code:
n = str(input())
wa = ""
for i in n:
  wa += i
if int(n)%int(wa) == 0:
  print("Yes")
else:
  print("No")

Fixed code:
n = str(input())
wa = ""
for i in n:
  wa += "+"+i

if int(n)%(eval(wa)) == 0:
  print("Yes")
else:
  print("No")
Buggy code:
n=int(input())

c=0
for i in str(n):
  c+=int(i)
  if n%c==0:
    print("Yes")
  else:
    print("No")

Fixed code:
n = input()
c = 0
for i in n:
  c += int(i)
print("Yes" if int(n)%c == 0 else "No")
Buggy code:
N = input()
x = sum(int(i) for i in N)
print("Yes" if N % x == 0 else "No")


Fixed code:
N = input()
x = sum(int(i) for i in N)
print("Yes" if int(N) % x == 0 else "No")
Buggy code:
n = list(map(int,input()))
y = int("".join(map(str,n)))
if y % sum(n) == 0:
    print("Yes")
else:
    print("No")
print(y,sum(n),n)

Fixed code:
n = list(map(int,input()))
y = int("".join(map(str,n)))
if y % sum(n) == 0:
    print("Yes")
else:
    print("No")
Buggy code:
N = str(input())
L = list(N)
f = 0
for l in L:
  f += l
if (int(N) % f) == 0:
  print("Yes")
else:
  print("No")

Fixed code:
N = str(input())
L = list(N)
f = 0
for l in L:
  f += int(l)
if (int(N) % f) == 0:
  print("Yes")
else:
  print("No")
Buggy code:
num=input()
s=0
for it in num:
    s+=int(it)
print(s)
num=int(num)
print("Yes" if num%s==0 else "No")



Fixed code:
num=input()
s=0
for it in num:
    s+=int(it)
num=int(num)
print("Yes" if num%s==0 else "No")
Buggy code:
N=input()
f=sum(list(map(int, str(N))))
if N%f==0:
  print('Yes')
else:
  print('No')

Fixed code:
N = int(input())
n = list(map(int,str(N)))
if N % sum(n) == 0:
    print("Yes")
else:
    print("No")
Buggy code:
def findSumOfDigits(n):
    sum = 0
    while(n > 0):
        sum += n % 10
        n //= 10
    return sum 

N = int(input())
sum = findSumOfDigits(N)
print(sum)
if N % sum == 0:
    print("Yes")
else:
    print("No")


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

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

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

Fixed code:
n=int(input())
x,t=n,0
while x:
    t+=x%10
    x//=10
print("Yes" if n%t==0 else "No")
Buggy code:
N=input()
A=int(input())
B=0
for i in N:
    B+=int(i)
if A%B==0:
    print("Yes")
else:
    print("No")

Fixed code:
N=input()
A=int(N)
B=0
for i in N:
	B+=int(i)
	
if A%B==0:
    print("Yes")
else:
    print("No")
Buggy code:
N = input()
fn = 0
for i in range(len(N)):
  fn += int(i)
  
print("Yes" if N % fn == 0 else "No")

Fixed code:
N = input()
fn = 0
for i in N:
  fn += int(i)
  
print("Yes" if int(N) % fn == 0 else "No")
Buggy code:
N = input()
f = lambda X:sum(int(x) for x in X)
print('Yes' if f(N)%int(N) == 0 else 'No')
    

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

Fixed code:
n = list(input())
N = ""
M = 0

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

N = int(N)

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

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

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

Fixed code:
n = int(input())
n_l = list(map(int,str(n)))

if n % sum(n_l) == 0:
  print('Yes')
else:
  print('No')
Buggy code:
N = int(input())
s = 0
for i in range(10):
    a = N % 10
    s += a
    if N // 10 == 0:
        break
    else:
        N = N // 10
if N % s == 0:
    print("Yes")
else:
    print("No")


Fixed code:
N = int(input())
n = N
s = 0
for i in range(10):
    a = n % 10
    s += a
    if n // 10 == 0:
        break
    else:
        n = n // 10
if N % s == 0:
    print("Yes")
else:
    print("No")
Buggy code:
N = int(input())

f = sum(int(d) for d in str(N))

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

Fixed code:
N = int(input())

f = sum(int(d) for d in str(N))

if N%f == 0:
  print("Yes")
else:
  print("No")
Buggy code:
n = input()
x = int(input())
fx = 0
for i in n:
  fx += int(i)
print('Yes' if x%fx ==0 else 'No')

Fixed code:
n = input()
x = int(n)
fx = 0
for i in n:
  fx += int(i)
print('Yes' if x%fx ==0 else 'No')
Buggy code:
x=input()
f=0
for i in len(x):
    f+=int(x[i])
if x%f==0:
    print("Yes")
else:
    print("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 = int(input())
l = list(n)
f = 0
for i in l:
  f += int(i)
if n%f == 0:
  print('Yes')
else:
  print('No')

Fixed code:
n = int(input())
l = list(str(n))
f = 0
for i in l:
  f += int(i)
if n%f == 0:
  print('Yes')
else:
  print('No')
Buggy code:

n = int(input())
total = 0
flag = 1
nn = n
while flag:
  total += nn % 10
  nn = nn // 10
  if nn <= 0:
    flag = 0

if total % n == 0:
  print("Yes")
else:
  print("No")

Fixed code:

n = int(input())
total = 0
flag = 1
nn = n
while flag:
  total += nn % 10
  nn = nn // 10
  if nn <= 0:
    flag = 0

if n % total == 0:
  print("Yes")
else:
  print("No")
Buggy code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

n = input()
print(n)
print(sum(map(int, n)))
x = sum(map(int, n))
print(int(n)/x)

if int(n) % sum(map(int, n)) == 0:
    print('Yes')
    exit()
else:
    print('No')


Fixed code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

n = input()
# print(n)
#print(sum(map(int, n)))
x = sum(map(int, n))
# print(int(n)/x)

if int(n) % sum(map(int, n)) == 0:
    print('Yes')
    exit()
else:
    print('No')
Buggy code:
import sys


def find_sum_of_digits(n):
    sum_of_digits = 0
    while n>0:
        sum_of_digits = sum_of_digits + n%10
        n = int(n/10)
    return sum_of_digits


n = int(input())
sum_of_digits = find_sum_of_digits(n)
if n % sum_of_digits == 0:
    print('Yes')
print('No')

Fixed code:
import sys


def find_sum_of_digits(n):
    sum_of_digits = 0
    while n>0:
        sum_of_digits = sum_of_digits + n%10
        n = int(n/10)
    return sum_of_digits


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


Fixed code:
n=input()
a = []
for i in range(len(n)):
  a.append(int(n[i]))
if int(n) % sum(a) == 0:
  print('Yes')
else:print('No')
Buggy code:
def sum_digits(n):
    r = 0
    while n / 10 > 0:
        r += n % 10
        n = math.floor(n/10)
    return r

if __name__ == '__main__':
    n = int(input())

    s = sum_digits(n)
    print(s)
    if n % s == 0:
        print('Yes')
    else:
        print('No')



Fixed code:
import math

def sum_digits(n):
    r = 0
    while n / 10 > 0:
        r += n % 10
        n = math.floor(n/10)
    return r


if __name__ == '__main__':
    n = int(input())

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

if M%res==0:
    print("Yes")
else:
    print("No")


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

if N%res==0:
    print("Yes")
else:
    print("No")
Buggy code:
N = int(input())
for i in N:
  sum += i
if sum % N == 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:
N = int(input())

s = 0
sN = str(N)
for i in range(len(sN)):
  s += sN[i]

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

Fixed code:
N = int(input())

s = 0
sN = str(N)
for i in range(len(sN)):
  s += int(sN[i])

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

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

f = False

x = sum(map(int,list(n)))

if n % x == 0:
    f = True

if f:
    print("Yes")
else:
    print("No")

Fixed code:
n = int(input())

f = False

x = sum(list(map(int, str(n))))

if n % x == 0:
    f = True

if f:
    print("Yes")
else:
    print("No")
Buggy code:
N = int(input())
temp = N
while temp > 0:
  test += temp %10
  temp //= 10
if N % test == 0:
  print('Yes')
else:
  print('No')

Fixed code:
N = int(input())
temp = N
test = 0
while temp > 0:
  test += temp %10
  temp //= 10
if N % test == 0:
  print('Yes')
else:
  print('No')
Buggy code:
n = int(input())
str_n = str(n)
wa = 0
for i in range(len(str_n)):
    wa += int(str_n[i])
if x%wa==0:
    print('Yes')
else:
    print('No')

Fixed code:
n = int(input())
str_n = str(n)
wa = 0
for i in range(len(str_n)):
    wa += int(str_n[i])
if n%wa==0:
    print('Yes')
else:
    print('No')
Buggy code:
n = int(input())
num = n
f = 0
while True:
    if num == 0:
        break
    f += num%10
    num = num//10

if n%num==0:
    print("Yes")
else:
    print("No")


Fixed code:
n = int(input())
num = n
f = 0
while True:
    if num == 0:
        break
    f += num%10
    num = num//10

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

Fixed code:
N = int(input())
print("Yes" if N % sum(map(int, str(N))) == 0 else "No")
Buggy code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 18 17:04:29 2017

@author: goto
"""
y=0
x=input()
print(type(x))
x_int=[int(x)for i in list(x)]
for i in range(len(x_int)):
    y+=x_int[i]
    
if int(x)/y==0:
    print("Yes")
else:
    print("No")
    




Fixed code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 18 17:04:29 2017

@author: goto
"""
y=0
x=input()

x_int=[int(i)for i in list(str(x))]
for i in range(len(x_int)):
    y+=x_int[i]
    

if int(x)%y==0:
    print("Yes")
else:
    print("No")
Buggy code:


def main():

    N = [i for i in input()]
    digitSum = sum(map(int,N))
    print('Yes') if int(''.join(N))%digitSum==0 else print('Noj')




if __name__== "__main__":
    main() 






Fixed code:


def main():

    N = [i for i in input()]
    digitSum = sum(map(int,N))
    print('Yes') if int(''.join(N))%digitSum==0 else print('No')




if __name__== "__main__":
    main()
Buggy code:
X = input()
sum = 0

for i in range(len(x)):
  sum += int(x[i])
  
if int(x) % sum == 0
  print("Yes")
else
  print("No")

Fixed code:
x = input()
sum = 0

for i in range(len(x)):
  sum += int(x[i])
  
if int(x) % sum == 0:
  print("Yes")
else:
  print("No")
Buggy code:
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


def is_harshad(n):
    p = n
    tmp = 0
    while p >= 10:
        p, q = divmod(p, 10)
        tmp += q
    tmp += p
    print(tmp)
    if n % tmp == 0:
        return True
    else:
        return False


N = int(input())

if is_harshad(N):
    print('Yes')
else:
    print('No')

Fixed code:
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


def is_harshad(n):
    p = n
    tmp = 0
    while p >= 10:
        p, q = divmod(p, 10)
        tmp += q
    tmp += p

    if n % tmp == 0:
        return True
    else:
        return False


N = int(input())

if is_harshad(N):
    print('Yes')
else:
    print('No')
Buggy code:
n=input()
x=0
for i in n:
  x+=i
if int(n)%x==0:
  print('Yes')
else:
  print('No')

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

Fixed code:
n = input()
N = list(n)
sum = 0
for i in range(len(N)):
  sum += int(N[i])
  
if int(n) % sum == 0:
  print("Yes")
else:
  print("No")
Buggy code:
n = int(input())
f_x=0
for i in range(len(n)):
    f_x+=int(n[i])
if int(n)%f_n==0:
    print('Yes')
else:
    print('No')

Fixed code:
n = input()
f_x=0
for i in range(len(n)):
    f_x+=int(n[i])
if int(n)%f_x==0:
    print('Yes')
else:
    print('No')
Buggy code:
n=int(input())
s=eval("+".join(n))
if n%s==0:
  print("Yes")
else:
  print("No")

Fixed code:
n=int(input())
s=eval("+".join(str(n)))
if n%s==0:
  print("Yes")
else:
  print("No")
Buggy code:
n=input()
m=n
s=0
while True:
  q,mod=divmod(m,10)
  s+=mod
  m=q
  if q<=0:
    break
if n%s==0:
  print("Yes")
else:
  print("No")


Fixed code:
n=int(input())
m=n
s=0
while True:
  q,mod=divmod(m,10)
  s+=mod
  m=q
  if q<=0:
    break
if n%s==0:
  print("Yes")
else:
  print("No")
Buggy code:
if __name__ == '__main__':
    n = int(input())
    s = str(n)
    sum=0
    for i in s:
        sum+= int(i)

    if n%sum ==0:
        print("Yes")
    else:
        print("Np")

Fixed code:
if __name__ == '__main__':
    n = int(input())
    s = str(n)
    sum=0
    for i in s:
        sum+= int(i)

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

while N_dammy>0:
    f += N_dammy % 10
    N_dammy = int(N_dammy/10) 

    print("f:",f)
    print("N_dammy:",N_dammy)

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

Fixed code:
N = int(input())
f = 0
N_dammy = N

while N_dammy>0:
    f += N_dammy % 10
    N_dammy = int(N_dammy/10) 

if N%f==0:
    print("Yes")
else:
    print("No")
Buggy code:
n = int(input())
n2 = n
summ = 0
while n > 0:
	mod = n % 10
	summ += mod
	n = n//10
print(n2)
if n2 % summ == 0:
	print("Yes")
else:
	print("No")


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

Fixed code:
n = input()
print("Yes" if int(n)%sum(map(int,n)) == 0 else "No")
Buggy code:
s=input()
n=[int(c) for c in s]
 if int(s)%sum(n)==0:
    print('Yes')
else:
    print('No')


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

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

if __name__=='__main__':
    main()


Fixed code:
def main():
    n=input()
    s=sum([int(i) for i in n])
    if int(n)%s==0:
        print("Yes")
    else:
        print("No")

if __name__=='__main__':
    main()
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())
F = 0
for i in range(9):
  a = N // (10**(8-i))
  F += a
  N = N - a*(10**(8-i))
if N % F== 0:
  print("Yes")
else:
  print("No")

Fixed code:
N= int(input())
F = 0
t = N
for i in range(9):
  a = N // (10**(8-i))
  F += a
  N = N - a*(10**(8-i))
if t % F== 0:
  print("Yes")
else:
  print("No")
Buggy code:
N = input()
def f(N):
  ret = 0
  for i in N:
    ret += int(i)
  return ret
if f(N) % int(N):
  print("Yes")
else:
  print("No")

Fixed code:
N = input()
def f(N):
  ret = 0
  for i in N:
    ret += int(i)
  return ret
if int(N) % f(N) == 0:
  print("Yes")
else:
  print("No")
Buggy code:
#ABC 080 B - Harshad Number
n = int(input())
if n/sum([int(c) for c in str(n)]) ==0:
    print('Yes')
else:
    print('No')


Fixed code:
#ABC 080 B - Harshad Number
n = int(input())
if n%sum([int(c) for c in str(n)]) == 0:
    print('Yes')
else:
    print('No')
Buggy code:
n = list(input())
sum = 0
for i in n:
  sum += int(i)
  
if sum%int(n) == 0:
  print('Yes')
else:
  print('No')
  

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

s = sum(map(int,list(N)))
if N % s == 0:
  print("Yes")
else:
  print("No")

Fixed code:
N = input()

s = sum(map(int,list(N)))
if int(N) % s == 0:
  print("Yes")
else:
  print("No")
Buggy code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = input()[:-1]
dig = 0
for c in N:
    dig += int(c)
if N % dig == 0:
    print("Yes")
else:
    print("No")


Fixed code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = input()[:-1]
dig = 0
for c in N:
    dig += int(c)
if int(N) % dig == 0:
    print("Yes")
else:
    print("No")
Buggy code:
n = input()
print('Yes' if sum([int(c) for c in n]) % int(n) == 0 else 'No')

Fixed code:
n = input()
print('Yes' if  int(n) % sum([int(c) for c in n]) == 0 else 'No')
Buggy code:
n = input()
m = list(n)

m = list(map(int,m))
print(m)
if int(n) % sum(m) == 0:
    print('Yes')
else:
    print('No')

Fixed code:
n = int(input())

if n % (sum(list(map(int, list(str(n)))))) == 0:
    print('Yes')
else:
    print('No')
Buggy code:
from sys import stdin
N=(stdin.readline().rstrip())
if sum(list(map(int,list(N)))) % N == 0:
    print("Yes")
else:
    print("No")

Fixed code:
from sys import stdin
N=(stdin.readline().rstrip())
if int(N) % sum(list(map(int,list(N)))) == 0:
    print("Yes")
else:
    print("No")
Buggy code:
a=input()
x=int(a)

y=0
for i in len(n):
  y+=int(i)

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

Fixed code:
a=input()
x=int(a)

y=0
for i in a:
  y+=int(i)

if x % y==0:
  print('Yes')
else:
  print('No')
Buggy code:
n=int(input())
f=0
frag='No'
for i in 8:
  f+=n%(10**(i+1))//10**i
if n%f==0:
  frag='Yes'
print(frag)

Fixed code:
n=int(input())
f=0
frag='No'
for i in range(8):
  f+=n%(10**(i+1))//10**i
if n%f==0:
  frag='Yes'
print(frag)
Buggy code:
n=int(input())
a=0
for i in range(len(str(n))):
    a+=n[i]
if n%a==0:
    print("Yes")
else:
    print("No")

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

Fixed code:
x = input()
fx = sum(map(int, x))
print("Yes" if int(x) % fx == 0 else "No")
Buggy code:
n=int(input())
def f(k):
  m=len(str(k))
  a=0
  for i in range(m):
    a+=str(k)[i]
  return a
if n%f(n)==0:
  print("Yes")
else:
  print("No")

Fixed code:
n=int(input())
def f(k):
  m=len(str(k))
  a=0
  for i in range(m):
    a+=int(str(k)[i])
  return a
if n%f(n)==0:
  print("Yes")
else:
  print("No")
Buggy code:
N = int(input())
s = str(N)
f = 0
for i in range(len(s)):
    f += int(s[i])

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

Fixed code:
N = int(input())
s = str(N)
f = 0
for i in range(len(s)):
    f += int(s[i])

if N%f == 0:
    print("Yes")
else:
    print("No")
Buggy code:
n = int(input())
print("Yes" if sum(map(int,n))%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())


def sumOfDigits(n):
    while n > 0:
        res = 0
        res += n % 10
        n //= 10

    return res


if n % sumOfDigits(n) == 0:
    print("Yes")
else:
    print("No")


Fixed code:
n = int(input())


def sumOfDigits(n):
    res = 0
    while n > 0:
        res += n % 10
        n //= 10

    return res


if n % sumOfDigits(n) == 0:
    print("Yes")
else:
    print("No")