浙江省信息技术选考字符串处理专题.pptxVIP

  • 5
  • 0
  • 约2.18千字
  • 约 35页
  • 2019-10-26 发布于广东
  • 举报

浙江省信息技术选考字符串处理专题.pptx

字符串处理专题、获取字符S=text1.textFor i=1 to len(s)a(i)=mid(s,i,1)Next iText1.textLen(s)Ch=mid(s,i,1)二、判断大小写字母数字等S=text1.textFor i=1 to len(s)ch=mid(s,i,1)If ch=”A” and ch=”Z” then List1.additem chEnd if Next i Len(txt)K3=k3+1三、相同字符的统计例:统计随机产生的(1~10)数字个数A(1)~a(10)初值为0For i=1 to 10X=int(rnd()*10+1)Next iFor i=1 to 10List1.additem str(i)+”是”+str(a(i))+“个”Next iA(x)=a(x)+1C=c+1Chr(i-64)三、大小写字母之间的转换 If s=”a” and s=”z” then End if S=chr(asc(s)-32)) If s=”A” and s=”Z” then End if S=chr(asc(s)+32))四、单词的统计在文本框text1输入英语短文,单击“统计”按钮,单词的个数显示在text2中(假定每个单词仅包含英文字母)。基本思路:按位取出字符,如果是字母,并且flag=false,说明是一个单词的开始,则单词个数增加1,

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档