怎样编写统计字母出现的次数的程序并将字母出现的个数显示在图片框中
来源:百度知道 编辑:UC知道 时间:2024/05/24 13:18:42
题目没有说明以哪一种语言实现, 以下为ASP代码实现的一种思路:
dim str, tmpStr
str = "abcdefghijklmnopabcdefghijklmnop"
dim sl : sl = len(str)
do while sl > 0
tmpStr = left(str, 1)
str = replace(str, tmpStr, "", 1) ' 不区分大小写
response.write("字符: " & tmpStr & " 的个数为 " & len(str) - sl)
sl = len(str)
loop