Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c6ea81a

Browse files
Create 5. PAT-1006
1 parent 3a57c01 commit c6ea81a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎5. PAT-1006‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
@Problem_Link: https://www.nowcoder.com/pat/6/problem/4042
3+
"""
4+
import sys
5+
6+
if __name__ == "__main__":
7+
A, DA, B, DB = sys.stdin.readline().strip("\n").split(" ")
8+
PA, PB = "", ""
9+
for ch in A:
10+
if ch == DA:
11+
PA += ch
12+
for ch in B:
13+
if ch == DB:
14+
PB += ch
15+
PA = 0 if PA == "" else int(PA)
16+
PB = 0 if PB == "" else int(PB)
17+
print(PA+PB)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /