A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
10
Task/Forward-difference/Perl/forward-difference.pl
Normal file
10
Task/Forward-difference/Perl/forward-difference.pl
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
sub dif {
|
||||
my @s = @_;
|
||||
map { $s[$_+1] - $s[$_] } 0 .. $#s-1
|
||||
}
|
||||
|
||||
sub difn {
|
||||
my ($n, @s) = @_;
|
||||
@s = dif @s foreach 1..$n;
|
||||
@s
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue