plse   1년 전

코드를 실행시키면 

line 21, in <module>graph.append(list(map(int,input())))
ValueError: invalid literal for int() with base 10: '\n'

라는 오류가 떠서 실행되지 않습니다

아무리 생각해봐도 코드 21번줄이 value error가 뜨는지 모르겠습니다

dong5995   1년 전

sys.stdin.readline은 \n도 같이 입력되기 때문에 map(int, input())라고 하면 숫자만 입력된 게 아니라서 int 변환이 안됩니다.

map(int, input().rstirp())로 바꿔보세요

plse   1년 전

해결되었습니다

감사합니다

댓글을 작성하려면 로그인해야 합니다.