Help for this page

Select Code to Download


  1. or download this
    > say [+] grep {$_ %% 5 or $_ %% 3}, 1..10;
    33
    
  2. or download this
    > sub sum3_5 (Int $max) { return [+] grep {$_ %% 5 or $_ %% 3}, 1..$ma
    +x};
    sub sum3_5 (Int $max) { #`(Sub|320422744) ... }
    > say sum3_5 10;
    33
    
  3. or download this
    > say reduce {$^a + $^b}, grep {$_ %% 5 or $_ %% 3}, 1..10;
    33
    
  4. or download this
    > say reduce * + *, grep {$_ %% 5 or $_ %% 3}, 1..10;
    33