回覆列表
  • 1 # 錢布斯

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    namespace case0401_11

    {

    class Program

    {

    static void Main(string[] args)

    {

    string[] a = new string[] {"春天","夏天","秋天","冬天" }; //建立一維陣列並賦初始化值

    //採用for迴圈語句遍歷資料元素

    Console.WriteLine("中文的一年四季:");

    for (int i = 0; i < a.Length; i++)

    {

    Console.WriteLine(a[i]);

    }

    a[0] = "Spring"; //對陣列元素重新賦值

    a[1] = "Summer";

    a[2] = "Autumn";

    a[3] = "Winter";

    Console.WriteLine("Seasons in English:");

    for (int i = 0; i < a.Length; i++)

    {

    Console.WriteLine(a[i]);

    }

    Console.Read();

    }

    }

    }

  • 中秋節和大豐收的關聯?
  • 一個多月的狗狗不吃東西,沒精神是怎麼啦?