【发布时间】:2011-11-19 14:40:50
【问题描述】:
my $line2 = ("My cat Garfield");
my $leng2 = length $line2;
my $longmatch;
my $post = 0;
my $letter = 1;
for(my $post = 0; $post < $leng2; $post++) {
for($letter = 1; $letter <= $leng2; $letter++) {
$longmatch = (substr($line2,$post,$letter));
print $longmatch, "\n";
}
}
如何消除重复的线条??
【问题讨论】:
-
您想打印多行,每行都比前一行长,还是一次打印一个字符(慢慢地)?贴出你的代码,会更容易理解...