题解 | #参数解析#
参数解析
http://www.nowcoder.com/practice/668603dc307e4ef4bb07bcd0615ea677
while True:
try:
str1=str(input())
str1=str1.replace(' ','\n')
去除双引号内的换行
e=''
flag= False
for i in str1:
if i=='"':
flag=not flag
elif flag==True and i=='\n':
e+=' '
else:
e+=i去除双引号内的换行
b=e.count('\n')+1
print(b)
print(e)
except:
break
查看23道真题和解析