話談C#第一天

今天是第一次接觸C#,因爲長時間的作Java開發,忽然轉到C#很是的不天然,可是也有了一些收穫,給你們分享一下dom

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace cong
{
    class Program
    {
        static void Main(string[] args)
        {
            const int N = 10;
            long[] a = new long[N];
            //int[] a = { 1, 2, 3 };
            var r = new Random();
            for (int i=0;i<N;i++) {
                a[i] = r.Next(1,10);
            }
            foreach (long x in a)
            {
                Console.WriteLine(x);
            }
            Console.WriteLine();
            Console.Read();
        }
    }
}
相關文章
相關標籤/搜索