Advertisement
pillgp

Untitled

Jan 30th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. G = int(input())
  2.  
  3. if 1 < G < 1000:
  4. gavetas = []
  5. inputGavetas = []
  6. numGavetas = 0
  7.  
  8. for i in range(0, G):
  9. estado = input()
  10. if estado == "#":
  11. inputGavetas.append(1)
  12. if i - 1 >= 0:
  13. if inputGavetas[i - 1] == 0:
  14. gavetas.append(0)
  15. else:
  16. gavetas.append(1)
  17. else:
  18. gavetas.append(1)
  19. elif estado == "o":
  20. inputGavetas.append(0)
  21. gavetas.append(0)
  22.  
  23. for i in range(0, len(gavetas)):
  24. numGavetas += gavetas[i]
  25.  
  26. print(numGavetas)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement