Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N = int(input())
- Coelho = 0
- Rato = 0
- Sapo = 0
- for data in range(N):
- input_data = str(input())
- split = input_data.split()
- number = int(split[0])
- letter = str(split[1])
- if letter == "C":
- Coelho += number
- elif letter == 'R':
- Rato += number
- elif letter == 'S':
- Sapo += number
- total = Coelho + Rato + Sapo
- average_coelho = (Coelho / total) * 100
- average_rato = (Rato / total) * 100
- average_sapo = (Sapo / total) * 100
- print("Total:",total,"cobaias")
- print("Total de coelhos:", Coelho)
- print("Total de ratos:", Rato)
- print("Total de sapos:", Sapo)
- print("Percentual de coelhos: %0.2f" % average_coelho, "%")
- print("Percentual de ratos: %0.2f" % average_rato, "%")
- print("Percentual de sapos: %0.2f" % average_sapo, "%")
- '''
- N = int(input())
- Coelho = 0
- Rato = 0
- Sapo = 0
- for data in range(N):
- input_data = str(input())
- split = input_data.split()
- number = int(split[0])
- letter = str(split[1])
- if letter == "C":
- Coelho += number
- elif letter == 'R':
- Rato += number
- elif letter == 'S':
- Sapo += number
- total = Coelho + Rato + Sapo
- average_coelho = (Coelho / total) * 100
- average_rato = (Rato / total) * 100
- average_sapo = (Sapo / total) * 100
- print("Total:",total,"cobaias"
- "\nTotal de coelhos:", Coelho,
- "\nTotal de ratos:", Rato,
- "\nTotal de sapos:", Sapo,
- "\nPercentual de coelhos: %0.2f" % average_coelho, "%",
- "\nPercentual de ratos: %0.2f" % average_rato, "%",
- "\nPercentual de sapos: %0.2f" % average_sapo, "%")
- '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement