改错!功能是:找出最长的单词。
功能是:找出最长的单词。请对其中2条错误语句进行修改,不允许修改总框架,算法,不增减语句
cstring='this is one of the best books'
ncount=0
cresult=SPACE(0)
DO WHILE LEN(cstring)>0
n=AT(SPACE(1),cstring)
cWord=ALLT(IIF(n=0,string,subs(cstring,1,n)))
cstring=ALLT(IIF(n=0,SPACE(0),SUBS(cstring,1,n)))
if len(cword)>ncount
ncount=ncount+1
cresult=cword
endif
enddo
wait window'最长的单词是'+cresult
谢谢!