Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import std.stdio;
- import std.array;
- import std.algorithm;
- import std.range;
- import std.conv;
- import std.typecons;
- static bool even(Tuple!(ulong, double) a) {
- return (a[0] & 1) == 0;
- }
- void main() {
- double[] arr = [31, 22, -3, 44, 51, 26, 47, 58, 19, 10];
- auto res1 = arr.enumerate.filter!(even).map!(a => a[1]);
- writeln(res1);
- writeln(__VERSION__);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement