728x90
반응형

단순 구현 문제이다. 그냥 반복문 두번 써서 틀린 경우를 확인해주면 된다.

ans = 0
for i in range(8):
    li = list(input())    
    for j in range(8):
        if (i % 2) and (j % 2) and li[j] == 'F':
            ans += 1
        elif (i % 2 == 0) and (j % 2 == 0) and li[j] == 'F':
            ans += 1
print(ans)
728x90
반응형

+ Recent posts