program.cs

来自「c#开发宝典 光盘内容。本光盘主要为书中的源程序」· CS 代码 · 共 21 行

CS
21
字号
using System;
using System.Collections.Generic;
using System.Text;

namespace Example4_8 {
    class Program {
        static void Main(string[] args) {
            int[] myArray = new int[5] { 12, 9, 35, 68, 51 };
            int a = 0;

            //创建一个while循环,只要a小于5,就会执行。
            while (a < 5) {
                Console.WriteLine("myArray[{0}]的值为{1}。", a, myArray[a]);
                a++;
            }

            Console.ReadLine();
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?