今天是第一次接触C#,由于长时间的做Java开发,突然转到C#非常的不自然,但是也有了一些收获,给大家分享一下
class="brush:csharp;gutter:true;">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();
}
}
}