StackOverflow 文档 D Language 教程 循环 对于循环 对于循环 Created: November-22, 2018 void main() { import std.stdio : writeln; int[] arr = [1, 3, 4]; for (int i = 0; i < arr.length; i++) { arr[i] *= 2; } writeln(arr); // [2, 6, 8] } 循环循环