stra = input("")
x = 0
z = 0
y = 0
for i in stra:
if i == '(':
x = x + 1
elif i == ')':
if x >= 0:
x = x - 1
else :
print("配对不成功")
if x != 0:
print("配对不成功")
else :
print("配对成功")
学号:37
标签:信计,20,成功,else,罗逸凡,print,stra,配对
来源: https://www.cnblogs.com/lyf238/p/15305984.html