请问大神们~
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace p3_10
{
class Program
{
static void Main(string[] args)
{
int x0 = 1, x1 = 3, x2 = 5;
AddFL(x0, x1, x2);
Console.WriteLine("x0={0},x2={1}", x0, x2);
int[] x = { x0, x1, x2 };
AddFL(x);
Console.WriteLine("x[0]={0},x[2]={1},", x[0], x[2]);
}
static void AddFL(params int[] array)
{
array[0] = array[0] + 1;
array[array.Length - 1] = array[array.Length - 1] + 1;
}
}
}
ADDFL方法将数组array的第一个和最后一个元素值分别加1,第一个元素加1我能看懂,可是最后一个元素为什么加1呢?求大神解释。。。。。。。。。。。。。。。