qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n, m, l = map(int, input().split())

A = [list(map(int,input().split())) for i in range(n)]

B = [list(map(int,input().split())) for i in range(m)]

C = [[0 for i in range(l)] for j in range(n)]

for i in range(0, n):
  for j in range(0, l):
    for k in range(0, m):
      C[i][j] = C[i][j] + A[i][k] * B[k][j] 

for i in range(0, n):
  for j in range(0, l):
    print(C[i][j],"", end="")
  print()    
      


Fixed code:
n, m, l = map(int, input().split())
A = [[0]*m for i in range(n)]
B = [[0]*l for i in range(m)]
C = [[0]*l for i in range(n)]

for i in range(n):
    A[i] = list(map(int, input().split()))
    
for i in range(m):
    B[i] = list(map(int, input().split()))
    
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for i in range(n):
    print("%d" %C[i][0], end="")
    for j in range(1, l):
        print(" %d" %C[i][j], end="")
    print()
Buggy code:
n, m, l = map(int, input().split())
a = []
b = []
for i in range(n):
    a.append(list(map(int, input().split())))
for j in range(m):
    b.append(list(map(int, input().split())))

c = [[0 for k in range(l)] for i in range(n)]
for i in range(n):
    for k in range(l):
        c[i][k]=sum([a[i][j]*b[j][k] for j in range(m)])
for i in range(n):
    print(c[i])


Fixed code:
n, m, l = map(int, input().split())
a = [];b = []
for _ in range(n):
    a.append(list(map(int, input().split())))
for _ in range(m):
    b.append(list(map(int, input().split())))

c = [[0]*l for _ in range(n)]
for i in range(n):
    for j in range(l):
        c[i][j] = sum(a[i][k] * b[k][j] for k in range(m))

for e in c:
    print(*e)
Buggy code:
n,m,l=map(int,input().split())
A=[list(map(int,input().split())) for i in range(n)]
B=[list(map(int,input().split())) for i in range(m)]
#print(A)
#print(B)

for i in range(n):
  for j in range(l):
    youso=0
    for k in range(m):
      youso+=A[i][k]*B[k][j]
    if l==0:
      print(youso,end="")
    else:
      print("",youso,end="")
  print("")


Fixed code:
n,m,l=map(int,input().split())
A=[list(map(int,input().split())) for i in range(n)]
B=[list(map(int,input().split())) for i in range(m)]
 
for i in range(n):
  for j in range(l):
    x=0
    for k in range(m):
      x+=A[i][k]*B[k][j]
    if j==0:
      print(x, end="")
    else:
      print("", x, end="")
  print("")
Buggy code:
n, m, l = map(int,input().split())
a = [list(map(int, input().split()))for i in range(n)]
b = [list(map(int, input().split()))for j in range(m)]
num = [[0 for i in range(l)]for j in range(n)]
for k in range(n):
    for i in range(l):
        for j in range(m):
            num[k][i] += a[k][j] * b[j][i]
for i in range(n):
    print(" ".join(map(num[i])))




Fixed code:
n, m, l = map(int, input().split())

a = [list(map(int, input().split())) for i in range(n)]
b = [list(map(int, input().split())) for i in range(m)]
s = [[0] * l for i in range(n)]

for i in range(n):
    for j in range(l):
        for k in range(m):
            s[i][j] += a[i][k] * b[k][j]

for i in range(n):
        print(" ".join(map(str, s[i])))
Buggy code:
n,m,l=map(int,input().split())
A=[list(map(int,input().split())) for i in range(n)]
B=[list(map(int,input().split())) for i in range(m)]
C=[[0]*l for i in range(n)]

for x in range(n):
    for y in range(m):
        for z in range(l):
            C[x][y] += A[x][z]*B[z][y]

for row in range(n):
    print("%d"%(C[row][0]),end="")
    for col in range(1,l):
        print(" %d"%(C[row][col]),end="")
    print()



Fixed code:
n,m,l = map(int,input().split())
 
A = [list(map(int,input().split())) for i in range(n)]
B = [list(map(int,input().split())) for i in range(m)]
ans = [[0]*l for i in range(n)]
 
 
for x in range(n):
    for y in range(l):
        for z in range(m):
            ans[x][y] += B[z][y]*A[x][z]
 
for row in range(n):
    print("%d"%ans[row][0],end = "")
    for col in range(1,l):
        print(" %d"%(ans[row][col]),end = "")
    print()
Buggy code:
n,m,l = map(int,input().split())
A = [[int(i) for i in input().split()] for j in range(n)]
B = [[int(i) for i in input().split()] for j in range(m)]
C = [[0 for i in range(n)] for k in range(l)]
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += A[i][k]*B[k][j]
for i in range(n):
    for j in C[i]:
        print(j,end=" ")
    print()

Fixed code:
n,m,l = map(int, input().split())

A = [[0 for i in range(m)] for j in range(n) ]

B = [[0 for i in range(l)] for j in range(m) ]

C = [[0 for i in range(l)] for j in range(n) ]

for i in range(n):
  data = input().split()
  for j in range(m):
    A[i][j] = int(data[j])
    
for i in range(m):
  data = input().split()
  for j in range(l):
    B[i][j] = int(data[j])

for i in range(n):
  for j in range(l):
    for k in range(m):
      C[i][j] += A[i][k] * B[k][j]

for i in range(n):
  print(*C[i])
Buggy code:
l, m, n = map(int,input().split())
a = [[0 for i in range(m)]for j in range(l)]
b = [[0 for i in range(n)]for j in range(m)]
c = [[0 for i in range(n)]for j in range(l)]

for i in range(l):
 a[i] = list(map(int, input().split()))

for i in range(m):
 b[i] = list(map(int, input().split()))

for i in range(l):
 for j in range(n):
  for k in range(m):
   c[i][j] += a[i][m] * b[m][j]
 print(" ".join([str(x) for x in c[i]]))

Fixed code:
n, m, l = map(int, input().split(' '))

a = [ [0 for j in range(m)] for i in range(n)]
b = [[0 for k in range(l)] for j in range(m)]
c = [[0 for k in range(l)] for i in range(n)]

for i in range(n):
    ls =  list(map(int, input().split(' ')))
    for j in range(m):
        a[i][j] = ls[j]

for j in range(m):
    lst =  list(map(int, input().split(' ')))
    
    for k in range(l):
        b[j][k] = lst[k]
        
for i in range(n):
    for k in range(l):
        for j in range(m):
            c[i][k] += a[i][j] * b[j][k]
    
for i in range(n):
    print(' '.join(list(map(str, c[i]))))
Buggy code:
n, m, l = map(int, input().split())
a = []
b = []
for i in range(n):
    a.append(list(map(int, input().split())))
for j in range(m):
    b.append(list(map(int, input().split())))

c = [[0 for k in range(l)] for i in range(n)]
for i in range(n):
    for k in range(l):
        for j in range(m):
            c[i][k] += int(a[i][j]*b[j][k] )
 for i in range(n):
    print(c[i])


Fixed code:
n,m,l=map(int, input().split())
a=[list(map(int, input().split())) for i in range(n)]
b=[list(map(int, input().split())) for i in range(m)]
c=[[0]*l for i in range(n)]
for i in range(n):
    for j in range(l):
        c[i][j]+=sum([a[i][k]*b[k][j] for k in range(m)])
for i in c:print(*i)
Buggy code:
n,m,l = map(int,input().split())
A = [[int(i) for i in input().split()] for i in range(n)]
B = [[int(i) for i in input().split()] for i in range(m)]
result = [[0 for i in range(l)] for i in range(n)]

for i in range(n):
    for j in range(m):
        for k in range(l):
            result[i][k] += A[i][j] * B[j][k]

for i in range(n):
    for j in result[i]:
        print(j, end=" ")
    print()

Fixed code:
n,m,l = map(int,input().split())
A = [[int(i) for i in input().split()] for i in range(n)]
B = [[int(i) for i in input().split()] for i in range(m)]
result = [[0 for i in range(l)] for i in range(n)]
 
for i in range(n):
    for j in range(m):
        for k in range(l):
            result[i][k] += A[i][j] * B[j][k]
 
for i in range(n):
        print(" ".join(map(str,result[i])))
Buggy code:
l, m, n = map(int,input().split())
a = [[0 for i in range(m)] for i in range(l)]
b = [[0 for i in range(n)] for i in range(m)]
c = [[0 for i in range(n)] for i in range(l)]

for i in range(l):
 a[i] = [int(x) for x in input().split()]

for i in range(m):
 b[i] = [int(x) for x in input().split()]

for i in range(l):
 for j in range(n):
  for k in range(m):
   c[i][j] += (a[i][m] * b[m][j])
 print(" ".join([str(x) for x in c[i]]))

Fixed code:
n, m, l = map(int, input().split())

a=[list(map(int,input().split())) for _ in range(n)] # n x m                    
b=[list(map(int,input().split())) for _ in range(m)] # m x l                    
c=[[0 for _ in range(l)] for _ in range(n)]

for i in range(n):
    for j in range(l):
        for k in range(m):
            c[i][j] += a[i][k]*b[k][j]

for i in c:
    print(' '.join(map(str, i)))
Buggy code:
n, m, l = map(int, input().split(' '))

A = []
for i in range(n):
    A.append(list(map(int, input().split(' '))))


B = []
for i in range(m):
    B.append(list(map(int, input().split(' '))))

C = [[0 for i in range(l)] for j in range(n)]

for i in range(n):
    for j in range(l):
        for k in range(m):
            print((i, j),(i, k), (k ,j))
            C[i][j] += A[i][k] * B[k][j]

for c in C:
    print(' '.join([str(x) for x in c]))

Fixed code:
n, m, l = map(int, input().split())
arrA = [[0 for i in range(m)] for j in range(n)]
arrB = [[0 for i in range(l)] for i in range(m)]
arrC = [[0 for i in range(l)] for j in range(n)]

for i in range(n):
    arrA[i] = list(map(int, input().split()))

for i in range(m):
    arrB[i] = list(map(int, input().split()))

for i in range(n):
    for j in range(l):
        c = 0
        for k in range(m):
            c += arrA[i][k] * arrB[k][j]
        arrC[i][j] = c

for i in range(n):
    print(' '.join(map(str, arrC[i])))
Buggy code:
n, m ,l = map(int, input().split())

A = [list(map(int,input().split())) for i in range(n)]
B = [list(map(int,input().split())) for j in range(m)]

C = [[0 for i in range(l)] for j in range(n)]

for i in range(l):
	for j in range(n):
		for k in range(m):
			C[i][j] + = (A[i][k] * B[k][j])

Cp = [print(" ".join(map(str, C[i]))) for i in range(n)]

Fixed code:
n, m, l = list(map(int, input().split()))
A = [[0]*m for i in range(n)]
B = [[0]*l for i in range(m)]
C = [[0]*l for i in range(n)]
for i in range(n):
  a = list(map(int, input().split()))
  for j in range(m):
    A[i][j] = a[j]
for i in range(m):
  b = list(map(int, input().split()))
  for j in range(l):
    B[i][j] = b[j]
for i in range(n):
  for j in range(l):
    for k in range(m):
      C[i][j] += A[i][k]*B[k][j]
for i in range(n):
  print(" ".join(map(str, C[i])))
Buggy code:
import sys
s = sys.stdin.read()

for i in range(26):


    s.count(chr(97+i))

    print(chr(97+i)+" : "+str(s.count(chr(97+i))))



Fixed code:
import sys
s=sys.stdin.read().lower()

for i in range(26):


    s.count(chr(97+i))

    print(chr(97+i)+" : "+str(s.count(chr(97+i))))
Buggy code:
import sys

alphabets = range(ord('a'), ord('z') + 1)
dic = { chr(c): 0 for c in alphabets }

text = sys.stdin.read()
for c in text:
  c = c.lower()
  if ord(c) in alphabets:
    dic[c] += 1

for item in sorted(dic.items()):
  print(*item)

Fixed code:
import sys

alphabets = range(ord('a'), ord('z') + 1)
dic = { chr(c): 0 for c in alphabets }

text = sys.stdin.read()
for c in text:
  c = c.lower()
  if ord(c) in alphabets:
    dic[c] += 1

for c, n in sorted(dic.items()):
  print(c, ":", n)
Buggy code:
import sys

a = sys.stdin.readline
alphabet = "abcdefghijklmnopqrstuvwxyz"

for i in alphabet:
    print(i + " : " + str(a.lower().count(i)) )

Fixed code:
import sys

a = sys.stdin.read()
alphabet = "abcdefghijklmnopqrstuvwxyz"

for i in alphabet:
    print(i + " : " + str(a.lower().count(i)) )
Buggy code:
#!usr/bin/env python3

import sys


def main():
    text = str()
    alphabets = 'abcdefghijklmnopqrstuvwxyz'

    for line in sys.stdin():
        text += line.lower()

    for alphabet in alphabets:
        print('%s : %d' % (alphabet, text.count(alphabet)))


if __name__ == '__main__':
    main()

Fixed code:
#!usr/bin/env python3

import sys


def main():
    text = str()
    alphabets = 'abcdefghijklmnopqrstuvwxyz'

    for line in sys.stdin:
        text += line.lower()

    for alphabet in alphabets:
        print('%s : %d' % (alphabet, text.count(alphabet)))


if __name__ == '__main__':
    main()
Buggy code:
import sys

Target = ""
for line in sys.stdin:
    Target += line
for i in range(26):
    print(chr(i + 97), ":", Target.count(chr(i + 97)))

Fixed code:
import sys

Target = ""
for line in sys.stdin:
    Target += line
for i in range(26):
    print(chr(i + 97), ":", Target.lower().count(chr(i + 97)))
Buggy code:
import sys
STRING = ""
for line in sys.stdin:
    STRING += line
CHRS = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',\
         'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in CHRS:
    print("%s : %d" % (i, STRING.count(i)))

Fixed code:
import sys
STRING = ""
for line in sys.stdin:
    STRING += line.lower()
CHRS = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',\
         'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in CHRS:
    print("%s : %d" % (i, STRING.count(i)))
Buggy code:
import sys
data = sys.stdin.read()
letters = 'abcdefghijklmnopqrstuvwxyz'
for letter in letters:
    count = 0
    for d in data:
        if letter == d:
            count += 1
    print(f'{letter} : {count}')



Fixed code:
import sys
data = sys.stdin.read()
letters = 'abcdefghijklmnopqrstuvwxyz'
for letter in letters:
    count = 0
    for d in data:
        if letter == d.lower():
            count += 1
    print(f'{letter} : {count}')
Buggy code:
import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

while True:
    try:
        lines += input().lower()
    except EOFError:
        break

for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

for key in string.ascii lowercase:
    print("{0} : {1}".format(key, count[key]))

Fixed code:
import string
   
count = {x: 0 for x in string.ascii_lowercase}
lines = ""
   
while True:
    try:
        lines += input().lower()
    except EOFError:
        break
           
for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1
           
for key in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))
Buggy code:
sentence = ''
while True:
    try:
        sentence += input().lower()
        except:
            break

for i in range(ord('a'), ord('z') + 1):
    print('{} : {}'.format(chr(i),sentence.count(chr(i))))

Fixed code:
sentence = ''
while True:
    try:
        sentence += input().lower()
    except:
            break

for i in range(ord('a'), ord('z') + 1):
    print('{} : {}'.format(chr(i),sentence.count(chr(i))))
Buggy code:
import sys
import string

# text = ""
# for line in sys.stdin:
#     text += line

text = input()
character_count_map = {}

for c in text:
    if c not in character_count_map:
        character_count_map[c] = 0
    character_count_map[c] += 1

for c in string.ascii_lowercase:
    if c in character_count_map:
        print(c, ":", character_count_map[c])
    else:
        print(c, ":", 0)

Fixed code:
import sys
import string

text = ""
for line in sys.stdin:
    text += line

character_count_map = {}

for c in text.lower():
    if c not in character_count_map:
        character_count_map[c] = 0
    character_count_map[c] += 1

for c in string.ascii_lowercase:
    if c in character_count_map:
        print(c, ":", character_count_map[c])
    else:
        print(c, ":", 0)
Buggy code:
import sys
s = sys.stdin.read()
for i in range(97,97+26):
    print('%s : %d' %(chr(i), s.count(chr(i))))
for i in range(65,65+26):
    print('%s : %d' %(chr(i), s.count(chr(i))))

Fixed code:
import sys
s = (sys.stdin.read()).lower()
for i in range(97,97+26):
    print('%s : %d' %(chr(i), s.count(chr(i))))
Buggy code:
import sys

alist = list('abcdefghijklmnopqrstuvwxyz')
r = {}
for al in alist:
    r[al] = 0

line = sys.stdin.read().lower

for i in range(len(line)):
    if line[i] in r.keys():
        r[line[i]] += 1

for k,v in r.items():
    print("{} : {}".format(k, v))


Fixed code:
import sys

alist = list('abcdefghijklmnopqrstuvwxyz')
r = {}
for al in alist:
    r[al] = 0

line = sys.stdin.read().lower()

for i in range(len(line)):
    if line[i] in r.keys():
        r[line[i]] += 1

for k,v in r.items():
    print("{} : {}".format(k, v))
Buggy code:
import sys
data = 'abcdefghijklmnopqrstuvwxyz'
for line in sys.stdin:
    sentence += line.lower()
for i in data:
    print(i + ' : ' + str(sentence.count(i)))

Fixed code:
import sys
sentence = ''
data = 'abcdefghijklmnopqrstuvwxyz'
for line in sys.stdin:
    sentence += line.lower()
for i in data:
    print(i + ' : ' + str(sentence.count(i)))
Buggy code:
import sys

table = "abcdefghijklmnopqrstuvwxyz"

sentence = sys.stdin.read()
sentence1 = str(entence.lower())
for i in table:
    print(i + ' : ' + str(sentence1.count(i)))


Fixed code:
import sys

table = "abcdefghijklmnopqrstuvwxyz"

sentence = sys.stdin.read()
sentence1 = sentence.lower()
for i in table:
    print(i + ' : ' + str(sentence1.count(i)))
Buggy code:
import sys
l = ""
for i in sys.stdin.readlines():
    l += i.lower().rstrip()
word = "abcdefghijklmnopqrstuvwxyz"
for i in word:
    n = l.count(i)
    print("{} :{}".format(i,n))


Fixed code:
import sys
l = ""
for i in sys.stdin.readlines():
    l += i.lower().rstrip()
word = "abcdefghijklmnopqrstuvwxyz"
for i in word:
    n = l.count(i)
    print("{} : {}".format(i,n))
Buggy code:
import sys
s = sys.stdin.read().lower()
for i in range (ord('a'), ord('z')+1):
	print(str(chr(i)), str(s.count(chr(i))), sep=':')

Fixed code:
import sys
s = sys.stdin.read().lower()
for i in range (ord('a'), ord('z')+1):
	print(str(chr(i)), str(s.count(chr(i))), sep=' : ')
Buggy code:
s=[int(0) for i in range(26)]
while True:
    try:
        x=[i for i in input()]
    except EOFError:
        pass
    for i in range(len(x)):
        if 97<=ord(x[i].lower())<=122:
            s[ord(x[i].lower())-97]=s[ord(x[i].lower())-97]+1
for i in range(26):
    print(chr(97+i),":",s[i])

Fixed code:
s=[int(0) for i in range(26)]
while True:
    try:
        x=input()
        for i in range(len(list(x))):
            if 97<=ord(list(x)[i].lower())<=122:
                s[ord(list(x)[i].lower())-97]=s[ord(list(x)[i].lower())-97]+1
    except EOFError:
        break
for i in range(26):
    print(chr(97+i),":",s[i])
Buggy code:
while True:
    try:
        words = input()
        words = words.lower()
        for i in [chr(i) for i in range(97,97+26)]:
            print('{0}:{1}'.format(i,words.count(i)))
    except:
        break

Fixed code:
wordcount = ""
while True:
    try:
        words = input()
        wordcount = wordcount + words.lower()
    except:
        break    
for i in [chr(i) for i in range(97,97+26)]:
    print('{0} : {1}'.format(i,wordcount.count(i)))
Buggy code:
import sys

s = ""
for line in sys.stdin:
    s+=line
s.lower()
for str in list("abcdefghijklmnopqrstuvwxyz"):
    print(*[str,":",s.count(str)])


Fixed code:
import sys

s = ""
for line in sys.stdin:
    s+=line
s=s.lower()
for str in list("abcdefghijklmnopqrstuvwxyz"):
    print(*[str,":",s.count(str)])
Buggy code:
import  string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

while True:
    try:
        lines += input().lower()
    except EOFError:
        break

fpr c in lines:
    if 'a' <= c <= 'z':
    count[c] += 1

for key in string.ascii lowercase:
    print("{0} : {1}".format(key, count[key]))

Fixed code:
import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

while True:
    try:
        lines += input().lower()
    except EOFError:
        break
        
for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

for key, in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))
Buggy code:
import sys
def lower(word):
    Word = ''
    str = list(word)
    for i in range(len(str)):
        if str[i].isupper(): Word += str[i].lower()
        else: Word += str[i]
    return Word
a = []
for line in sys.stdin:
    a.extend(list(line))
    print(a)

count = [0] * 26
for i in range(len(a)):
    a[i] = lower(a[i])
    if 97 <= ord(a[i]) and ord(a[i]) < 123:
        count[ord(a[i]) - 97] += 1
for i in range(26):
    print(chr(i + 97) + ' : ' + str(count[i]))


Fixed code:
import sys
def lower(word):
    Word = ''
    str = list(word)
    for i in range(len(str)):
        if str[i].isupper(): Word += str[i].lower()
        else: Word += str[i]
    return Word
a = []
for line in sys.stdin:
    a.extend(list(line))


count = [0] * 26
for i in range(len(a)):
    a[i] = lower(a[i])
    if 97 <= ord(a[i]) and ord(a[i]) < 123:
        count[ord(a[i]) - 97] += 1
for i in range(26):
    print(chr(i + 97) + ' : ' + str(count[i]))
Buggy code:
import sys

letter="abcdefghijklmnopqrstuvwxyz"
while True:
    table=[0]*26
    try:
        input_str=input()
    except:
        break
    for A in input_str:
        index=0
        for B in letter:
            if A == B or A == B.upper():
                table[index] += 1
                break
                index += 1

    for i in range(len(letter)):
        print("%s : %d"%(letter[i],table[i]))



Fixed code:
letter="abcdefghijklmnopqrstuvwxyz"
table=[0]*26
while True:
    try:
        input_str=input()
    except:
        break
    for A in input_str:
        index=0
        for B in letter:
            if A == B or A == B.upper():
                table[index] += 1
                break
            index += 1

for i in range(len(letter)):
    print("%s : %d"%(letter[i],table[i]))
Buggy code:
import sys

data = sys.stdin().read()
for i in range(0x61,0x7b):
    print("%c : %d"  %(i,data.lower().count(chr(i))))


Fixed code:
import sys

data = sys.stdin.read()
for i in range(0x61,0x7b):
    print("%c : %d"  %(i,data.lower().count(chr(i))))
Buggy code:
import sys
words = str()
data = "abcdefghijklmnopqrstuvwxyz"
for line in sys.stdin:
    data += line.lower()
for i in data:
    print(i+" : "+str(words.count(i)))

Fixed code:
import sys
words = str()
data = "abcdefghijklmnopqrstuvwxyz"
for line in sys.stdin:
    words += line.lower()
for i in data:
    print(i+" : "+str(words.count(i)))