logo
  • 教程列表
  • SO官方文檔
  • 迴圈
    • Foreach 迴圈
    • for 迴圈
    • 做 - 迴圈
    • 迴圈風格
    • 巢狀迴圈
    • 打破
    • 迴圈
    • 繼續
  1. StackOverflow 文件
  2. C# Language 教程
  3. 迴圈
  4. 巢狀迴圈

巢狀迴圈

Created: November-22, 2018

// Print the multiplication table up to 5s
for (int i = 1; i <= 5; i++)
{
    for (int j = 1; j <= 5; j++)
    {
        int product = i * j;
        Console.WriteLine("{0} times {1} is {2}", i, j, product);
    }
}
  • 打破
  • 迴圈風格

Copyright © 2018. All right reserved

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

  • 關於本站
  • 免責聲明