#!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";
}
阅读(2847) | 评论(0) | 转发(0) |