fork download
  1. void main(string[] args)
  2. {
  3. import std.range, std.algorithm, std.stdio;
  4. auto x = [10,20,30,40];
  5. x.enumerate.each!(a => writeln("i = ", a[0], " value = ", a[1]));
  6. }
Success #stdin #stdout 0s 16472KB
stdin
Standard input is empty
stdout
i = 0 value = 10
i = 1 value = 20
i = 2 value = 30
i = 3 value = 40