Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1515058
  • 博文数量: 289
  • 博客积分: 11086
  • 博客等级: 上将
  • 技术积分: 3291
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-22 17:06
个人简介

徐小玉的博客。

文章分类

全部博文(289)

文章存档

2023年(6)

2022年(1)

2021年(2)

2020年(9)

2019年(9)

2018年(6)

2017年(10)

2016年(10)

2014年(3)

2013年(4)

2011年(12)

2010年(16)

2009年(14)

2008年(119)

2007年(48)

2006年(20)

我的朋友

分类:

2007-09-17 17:29:51

#!perl -w
  print "please input the String:\n";
  my $data = ;
  chomp($data);
 
  &ABC($data);
 
  sub ABC
  {       
    chomp(@_);
     my ($str) = @_;
     my $i;
     my $count=0;
     my $lent = length($str);  
    for ( $i=0;$i<=$lent; $i++)
    {    
        my $str_current = substr($str,$i,1);   
        chomp($str_current); 
        if ($str_current =~ /[a-zA-Z]/)
        {
         $count++;
         }     
     } 
     print "the total is ::::::$count\n";
 }
阅读(2772) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~