logo
  • 教程列表
  • SO官方文檔
  • 迴圈
    • 對於迴圈
    • 迴圈
    • 這樣做,而
    • foreach
    • 打破繼續標籤
  1. StackOverflow 文件
  2. D Language 教程
  3. 迴圈
  4. 對於迴圈

對於迴圈

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]
}
  • 迴圈
  • 迴圈

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明