代码展示:
A, DA, B, DB = input().split()
# print('A =', A, type(A))
# print('DA =', DA, type(DA))
# print('B =', B, type(B))
# print('DB =', DB, type(DB))
PA = 0
for a in A:
if a == DA:
PA *= 10
PA += int(DA)
PB = 0
for b in B:
if b == DB:
PB *= 10
PB += int(DB)
print(PA+PB)
测评结果:

这篇博客展示了如何解决A+B问题的代码实现。通过输入的字符串A、DA、B和DB,程序逐字符比较并计算出PA和PB的值,最后将两者相加得出结果。博客内容主要涉及字符串处理和基本算术运算。

 #1016 部分A+B 15 分&spm=1001.2101.3001.5002&articleId=119064988&d=1&t=3&u=8ec74fd479e14cb187ed9346640a1924)
357

被折叠的 条评论
为什么被折叠?



