1268번 - 임시 반장 정하기
a=int(input())
blist=[]
for i in range(a):
b=list(map(int,input().split()))
blist.append(b)
totallist=[]
for x in range(a):
total=0
for y in range(a):
tempnum=blist[x][y]
for z in range(a):
if tempnum==blist[z][y]:
total+=1
totallist.append(total-5)
maxtotallist=max(totallist)
for xyz in range(len(totallist)):
if totallist[xyz]==maxtotallist:
print(xyz+1)
break
프로그램 코드는 아래 "소스 코드" 란에 써야 합니다
본문 란에 쓰면 syntax highlight 도 안 되고 indent 도 모두 깨져서 알아보기 매우 힘듭니다
특히, 사용하고 계신 언어가 python 인 것 같은데, python 의 indent 는 언어 문법이기 때문에 indent 가 깨진 코드는 올바른 코드가 아닙니다
댓글을 작성하려면 로그인해야 합니다.
seoulhandsomeguy 1년 전
a=int(input())
blist=[]
for i in range(a):
b=list(map(int,input().split()))
blist.append(b)
totallist=[]
for x in range(a):
total=0
for y in range(a):
tempnum=blist[x][y]
for z in range(a):
if tempnum==blist[z][y]:
total+=1
totallist.append(total-5)
maxtotallist=max(totallist)
for xyz in range(len(totallist)):
if totallist[xyz]==maxtotallist:
print(xyz+1)
break