Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. while True:
  3.     # Número de vezes jogadas
  4.     # 1 ≤ N ≤ 10000
  5.     n = int(input())
  6.     if n == 0:
  7.         break
  8.    
  9.     john = mary = 0
  10.    
  11.     # Lista de resultados
  12.     r = input()
  13.    
  14.     for i in range(0, n*2, 2):
  15.         if r[i] == '0':
  16.             mary += 1
  17.         else:
  18.             john += 1
  19.    
  20.     print("Mary won %d times and John won %d times" % (mary, john))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement