P03 - 查找列表中的第 k 个元素。
作者:Ryan Connelly
示例
> say get-at(<a b c d e>, 4) e
源代码:P03-topo.pl
use v6;
sub get-at(@list, $elem)
{
@list[$elem];
}
say get-at(<a b c d e>, 4);
作者:Ryan Connelly
> say get-at(<a b c d e>, 4) e
源代码:P03-topo.pl
use v6;
sub get-at(@list, $elem)
{
@list[$elem];
}
say get-at(<a b c d e>, 4);