Skip to content

Commit 47e6c8e

Browse files
committed
Solve Santa's Toys in python
1 parent 863e1bf commit 47e6c8e

File tree

5 files changed

+45
-0
lines changed

5 files changed

+45
-0
lines changed

solutions/beecrowd/3039/3039.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
n = int(input())
2+
3+
male_count = 0
4+
female_count = 0
5+
6+
for _ in range(n):
7+
name, gender = input().split()
8+
if gender == 'M':
9+
male_count += 1
10+
else:
11+
female_count += 1
12+
13+
print(f'{male_count} carrinhos')
14+
print(f'{female_count} bonecas')

solutions/beecrowd/3039/in.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
5
2+
Milena F
3+
Joao M
4+
Rafaela F
5+
Renata F
6+
Felipe M

solutions/beecrowd/3039/out.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2 carrinhos
2+
3 bonecas

solutions/beecrowd/3039/problem.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
https://judge.beecrowd.com/en/problems/view/3039
2+
3+
# Santa's Toys
4+
5+
Santa Claus reads Christmas letters every year to know what to give to each
6+
child. The problem is, many kids don't send their letters to Santa Claus, so he
7+
decided that to save his time, he will give the same gift to children who didn't
8+
send letters. So he decided that for children who are boys, he will give a toy
9+
car, and for girls a doll.
10+
11+
## Input
12+
13+
The first line of the entry has an integer $N (0 \lt N \leq 1000)$, the number
14+
of children who didn't send their letter to Santa. The next $N$ lines consist of
15+
two strings, the first is the child's name, and the second is a letter, which
16+
can be 'M', to say it's a boy, or 'F' if it's a girl.
17+
18+
## Output
19+
20+
The output consists of 2 lines. The first line should contain the number of toy
21+
cars that Santa should make, followed by the word "carrinhos", and on the second
22+
line, the number of dolls followed by the word "bonecas".

solutions/beecrowd/3039/tags.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
beginner

0 commit comments

Comments
 (0)