Skip to content

Commit 4319723

Browse files
committed
Create 339A - Helpful Maths.py
1 parent 8ce6f26 commit 4319723

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

339A - Helpful Maths.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#4362738 Aug 28, 2013 6:54:41 PM fuwutu 339A - Helpful Maths Python 3 Accepted 92 ms 0 KB
2+
s = input()
3+
n1 = n2 = n3 = 0
4+
for i in range(0, len(s), 2):
5+
if s[i] == '1':
6+
n1 += 1
7+
elif s[i] == '2':
8+
n2 += 1
9+
else:
10+
n3 += 1
11+
ss = "1+" * n1 + "2+" * n2 + "3+" * n3
12+
print(ss[:-1])

0 commit comments

Comments
 (0)