rroossaee   1년 전

제시된 예제들과 제가 만든 예제들도 모두 잘 출력되는데, 뭐가 잘못됐는지 모르겠습니다ㅠㅠ

런타임 에러 납니다..

littlehippo   1년 전

j

factories   1년 전

입력: z=d-

정답 : 2

실행 결과:

런타임 에러 (RTE)
stderr:
Traceback (most recent call last):

File "/tmp/target/Main.py", line 11, in <module>

if strng[i+1] == 'z' and strng[i+2] == 'd':

IndexError: string index out of range

런타임 에러입니다.

(testcase.ac 사용)

realsound   1년 전

열번째 줄의 

if i != len(strng) - 1:

가

if i < len(strng) - 2

로 바뀌어야 할 것 같습니다.

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