根据asc码分别进行统计,看有多少字母和符号,汉字分开统计,一个汉字算计数1
function TFrm_main.MsgCounter(str: string): string;
var
s:string; //保存字符串
i,e,c:integer;//保存变量
begin
s:=str;
e:=0;c:=0;
for i:=1 to length(s) do
begin
if (ord(s[i])>=33)and(ord(s[i])<=126) then
//判断字符的顺序号
begin
inc(e);
end
else
if (ord(s[i])>=127) then
//判断字符的顺序号
begin
inc(c);
end;
end;
Result:=IntToStr(e+(c div 2));
end;
这是什么语言写的呀?
这个是什么语言编写的
代码是用C写的吗?
看起来很觉得,不错,很有帮助,感谢分享了,博主。
站长你好 很喜欢贵站博客 申请贵站友情链接
网址 www.zhuoyue126.cn
标题 卓越
贵站链接已经做好