体育场座位【python实现】
题目来自此处
def main():
seats = list(map(int,input().split()))
count = 0
for i in range(len(seats)):
if seats[i] == 0:
if (i ==0 or seats[i-1] == 0) and(i == len(seats)-1 or seats[i+1] == 0):
count += 1
seats[i] = 1
print(seats)
print(count)
if __name__ == "__main__":
main()