pat乙级1006python代码

python代码,pat乙1006 不知道代码哪里错了

img


img


m = input()
n = int(m)
a = n/100
b = (n/10) % 10
c = n % 10
i = 1
while i < a:
i += 1
print("B", end="")
i = 1
while i < b:
i += 1
print("S", end="")
i = 0
while i < c:
i += 1
print(i, end="")

前两个i初始值也是0

i=0
while i < a:
    i += 1
    print("B", end="")
i = 0
while i < b:
     i += 1
     print("S", end="")
i