优质解答
dim i as integer,s as integer for i =1 to 10 s=s+i if s>10 then print s s=0 end if next i end sub 当s=1+2+3+4+5=15 s>10 显示15,赋予s=0 当s=6+7=13 s>10 显示13,s=0 当s=8+9=17 s>10 显示17,s=0 total =0 for m= 1 to 3 if m>=1 then part=1 elseif m>=2 then part=2 elseif m>=3 then part=3 else part=4 end if print part total=total+part next m print total i=1 part=1 total=1 显示1 i=2 part=1 total=2 显示1 i=3 part=1 total=3 显示1 循环结束 显示total,3 if语句中其实条件是包含关系,所以满足第一个条件后就结束了 所以一般分支语句的条件应该是互斥的,要不会得到错误的结果 dim mst as string,mst1 as string,mst2 as string dim i as integer mst1="CeBbAd" for i=len(mst1)to 1 step -2 mst2=mid(mst1,i-1,2) mst=mst&mst2 print mst next i end sub i的取数是6 to 1 -2,循环即为i=6,4,2 i=6 mst2=mid("CeBbAd",5,2)="Ad",mst="Ad" i=4 mst2=mid("CeBbAd",3,2)="Bd",mst="AdBd" i=2 mst2=mid("CeBbAd",1,2)="Ce",mst="AdBdCe" 我觉得答案是AdAdBbAdBbCe 错了?请高手指正吧 private sub command1_click () dim s as string,i as integer const ch as string="0123456789" s="2L0A08U.1SI0V.11" text1="" text2="" for i =1 to len(s) if instr(ch,mid(s,i,1))=0 then text1=mid(s,i,1)&text1 else text2=text2&mid(s,i,1) end if next i end sub i=1 to 16 i=1 instr(ch,mid(s,1,1))0 text2=mid(s,1,1)="2" i=2 instr(ch,mid(s,2,1))=0 text1="L" i=3 instr(ch,mid(s,3,1))0 text2="2" & mis(s,3,1)="20" i=4 instr(ch,mid(s,4,1))=0 text1=mid(s,4,1) & "L"="AL" ………… 提一下,好像const ch as string="0123456789" 里面应该包含一个小数点
dim i as integer,s as integer for i =1 to 10 s=s+i if s>10 then print s s=0 end if next i end sub 当s=1+2+3+4+5=15 s>10 显示15,赋予s=0 当s=6+7=13 s>10 显示13,s=0 当s=8+9=17 s>10 显示17,s=0 total =0 for m= 1 to 3 if m>=1 then part=1 elseif m>=2 then part=2 elseif m>=3 then part=3 else part=4 end if print part total=total+part next m print total i=1 part=1 total=1 显示1 i=2 part=1 total=2 显示1 i=3 part=1 total=3 显示1 循环结束 显示total,3 if语句中其实条件是包含关系,所以满足第一个条件后就结束了 所以一般分支语句的条件应该是互斥的,要不会得到错误的结果 dim mst as string,mst1 as string,mst2 as string dim i as integer mst1="CeBbAd" for i=len(mst1)to 1 step -2 mst2=mid(mst1,i-1,2) mst=mst&mst2 print mst next i end sub i的取数是6 to 1 -2,循环即为i=6,4,2 i=6 mst2=mid("CeBbAd",5,2)="Ad",mst="Ad" i=4 mst2=mid("CeBbAd",3,2)="Bd",mst="AdBd" i=2 mst2=mid("CeBbAd",1,2)="Ce",mst="AdBdCe" 我觉得答案是AdAdBbAdBbCe 错了?请高手指正吧 private sub command1_click () dim s as string,i as integer const ch as string="0123456789" s="2L0A08U.1SI0V.11" text1="" text2="" for i =1 to len(s) if instr(ch,mid(s,i,1))=0 then text1=mid(s,i,1)&text1 else text2=text2&mid(s,i,1) end if next i end sub i=1 to 16 i=1 instr(ch,mid(s,1,1))0 text2=mid(s,1,1)="2" i=2 instr(ch,mid(s,2,1))=0 text1="L" i=3 instr(ch,mid(s,3,1))0 text2="2" & mis(s,3,1)="20" i=4 instr(ch,mid(s,4,1))=0 text1=mid(s,4,1) & "L"="AL" ………… 提一下,好像const ch as string="0123456789" 里面应该包含一个小数点