Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Eertree/Perl/eertree.pl
Normal file
16
Task/Eertree/Perl/eertree.pl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
$str = "eertree";
|
||||
|
||||
for $n (1 .. length($str)) {
|
||||
for $m (1 .. length($str)) {
|
||||
$strrev = "";
|
||||
$strpal = substr($str, $n-1, $m);
|
||||
if ($strpal ne "") {
|
||||
for $p (reverse 1 .. length($strpal)) {
|
||||
$strrev .= substr($strpal, $p-1, 1);
|
||||
}
|
||||
($strpal eq $strrev) and push @pal, $strpal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print join ' ', grep {not $seen{$_}++} @pal, "\n";
|
||||
Loading…
Add table
Add a link
Reference in a new issue