话谈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();
        }
    }
}
相关文章
相关标签/搜索